From patchwork Fri Mar 23 19:23:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 890157 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZnXxtbSB"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 407DDD4bYCz9rxs for ; Sat, 24 Mar 2018 06:31:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbeCWTbH (ORCPT ); Fri, 23 Mar 2018 15:31:07 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:37177 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751892AbeCWTbG (ORCPT ); Fri, 23 Mar 2018 15:31:06 -0400 Received: by mail-pg0-f65.google.com with SMTP id n11so4948255pgp.4; Fri, 23 Mar 2018 12:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=8Mvc84f8kQobieSPve/S8l5ncEBE8szTC3QOafaC4VQ=; b=ZnXxtbSBuvQTcTTfaWt4Q5ziiRg4SlsD7gJ7Gq9HckSPEohbxucPA7MEFn8gZdqriE ue+IiXQaKeu0V0EXWL1VoFvXAojhPKe+Q8/YAEekRF0f1UjygFZjceDSafMH6Aam06Zd GHqlYipl0upiRmy47FTbl5kk81upSPoLGEhWYfofJMmlXAwTZ7sy6+gMHeau8ML6Uf9r ci8wiwUHUL8QN1LgnUtiV31b/VMuVpgGrsbjyI8v87d2OgS/jB1Ml1Uz0gUuXqeNmCJ8 Tm6NFGexO2CwW6W2BinbgKQjYmTTjz3qTAHl3VxAxcltVpsxIzX8OBJx5q14P5Svn5s+ TOww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8Mvc84f8kQobieSPve/S8l5ncEBE8szTC3QOafaC4VQ=; b=kenH6/rXuAJZA9NtHRy17tPiPqE9Eu24jhy5OhZQw1ITbyvVCDamrTW9Mv5YKECH8A xbSeTk89HZozAR+90qKGwmNMixFF7XHM+MJbPy8R+4SLOURFF/UbXD3C2+kqUjjq/QWk oDMRn6YF0deRkkhg/bd2mUFkRdtsG+Edy3tfRsxlSTboDv4tMPThSyoAftzjvxA5BCic 1j85gs/IYER085P/jRFqqkO21PM6k0mOIZuMjr/ao/e4srklJjztmNaWucjf1Ilbm7zq G8mb7F4+nQYLyHPdDVVYKSPBmQwaGJ8K8+gFUrIuPXFNEBYiZyoBHBZj13wKu3Nlboby Xo8Q== X-Gm-Message-State: AElRT7Fb26i3cLSDqpNgz7vkzBPY7HAV10mkee6byRDERGP9P1ZH8vk4 P+7V+diEDdvpNGwn+6cVYKmRnyNY X-Google-Smtp-Source: AG47ELtF2LV/faGol5DamsN9PfHhgzCFCNPMSEQYYXrjTk1j2yzWTlorcFvWjNns01miM7UFGWhyow== X-Received: by 10.98.141.205 with SMTP id p74mr15927106pfk.210.1521833465348; Fri, 23 Mar 2018 12:31:05 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id x1sm20924545pfk.144.2018.03.23.12.31.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 12:31:04 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Jaegeuk Kim , Eric Biggers Subject: [PATCH 00/14] fscrypt: improved logging and other cleanups Date: Fri, 23 Mar 2018 12:23:44 -0700 Message-Id: <20180323192358.95691-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.17.0.rc0.231.g781580f067-goog Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Eric Biggers Hi, here's yet another round of cleanups for fscrypt. Please consider for v4.17. Patches 1-11 remove some unnecessary or redundant code from a number of different places; nothing particularly noteworthy. Patch 12 switches the existing warning and error messages in fscrypt over to use a common logging function, which is ratelimited and includes the filesystem name (->s_id) when available as well as a consistent prefix of "fscrypt:". Patches 13-14 are optimizations and cleanups for key lookup and key derivation. They are extracted from the patch "fscrypt: refactor finding and deriving key" I had originally sent as part of the series "fscrypt: filesystem-level keyring and v2 policy support". But I think they're useful changes by themselves, so no need to wait on them. This series can also be retrieved from git at https://github.com/ebiggers/linux, branch "fscrypt_2018-03-23". Note that it's on top of a few other fscrypt patches I've sent out this cycle: fscrypt: clean up after fscrypt_prepare_lookup() conversions fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled fscrypt: add Speck128/256 support Eric Biggers (14): fscrypt: remove unnecessary NULL check when allocating skcipher fscrypt: remove error messages for skcipher_request_alloc() failure fscrypt: remove WARN_ON_ONCE() when decryption fails fscrypt: remove stale comment from fscrypt_d_revalidate() fscrypt: don't clear flags on crypto transform fscrypt: don't special-case EOPNOTSUPP from fscrypt_get_encryption_info() fscrypt: drop max_namelen check from fname_decrypt() fscrypt: drop empty name check from fname_decrypt() fscrypt: make fscrypt_operations.max_namelen an integer fscrypt: remove unnecessary check for non-logon key type fscrypt: remove internal key size constants fscrypt: use a common logging function fscrypt: separate key lookup from key derivation fscrypt: only derive the needed portion of the key fs/crypto/bio.c | 6 +- fs/crypto/crypto.c | 35 ++++-- fs/crypto/fname.c | 32 ++---- fs/crypto/fscrypt_private.h | 18 ++-- fs/crypto/hooks.c | 5 +- fs/crypto/keyinfo.c | 202 ++++++++++++++++++----------------- fs/ext4/super.c | 8 +- fs/f2fs/super.c | 8 +- fs/ubifs/crypto.c | 10 +- include/linux/fscrypt_supp.h | 2 +- 10 files changed, 161 insertions(+), 165 deletions(-)