All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: linux-fscrypt@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org,
	"Theodore Y . Ts'o" <tytso@mit.edu>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Michael Halcrow <mhalcrow@google.com>,
	Eric Biggers <ebiggers@google.com>
Subject: [PATCH 2/4] ext4: remove "nokey" check from ext4_lookup()
Date: Fri,  7 Apr 2017 10:58:38 -0700	[thread overview]
Message-ID: <20170407175840.95740-3-ebiggers3@gmail.com> (raw)
In-Reply-To: <20170407175840.95740-1-ebiggers3@gmail.com>

From: Eric Biggers <ebiggers@google.com>

Now that fscrypt_has_permitted_context() correctly handles the case
where we have the key for the parent directory but not the child, we
don't need to try to work around this in ext4_lookup().

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 fs/ext4/namei.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 6ad612c576fc..600b37874038 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1616,16 +1616,9 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi
 		if (!IS_ERR(inode) && ext4_encrypted_inode(dir) &&
 		    (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
 		    !fscrypt_has_permitted_context(dir, inode)) {
-			int nokey = ext4_encrypted_inode(inode) &&
-				!fscrypt_has_encryption_key(inode);
-			if (nokey) {
-				iput(inode);
-				return ERR_PTR(-ENOKEY);
-			}
 			ext4_warning(inode->i_sb,
 				     "Inconsistent encryption contexts: %lu/%lu",
-				     (unsigned long) dir->i_ino,
-				     (unsigned long) inode->i_ino);
+				     dir->i_ino, inode->i_ino);
 			iput(inode);
 			return ERR_PTR(-EPERM);
 		}
-- 
2.12.2.715.g7642488e1d-goog

  parent reply	other threads:[~2017-04-07 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 17:58 [PATCH 0/4] fscrypt context consistency check fixes Eric Biggers
2017-04-07 17:58 ` [PATCH 1/4] fscrypt: fix context consistency check when key(s) unavailable Eric Biggers
2017-04-30  6:17   ` [1/4] " Theodore Ts'o
2017-05-02 17:36     ` Eric Biggers
2017-05-04 15:49       ` Theodore Ts'o
2017-04-07 17:58 ` Eric Biggers [this message]
2017-04-30  6:17   ` [2/4] ext4: remove "nokey" check from ext4_lookup() Theodore Ts'o
2017-04-07 17:58 ` [PATCH 3/4] f2fs: sync f2fs_lookup() with ext4_lookup() Eric Biggers
2017-04-30  6:18   ` [3/4] " Theodore Ts'o
2017-04-07 17:58 ` [PATCH 4/4] ubifs: check for consistent encryption contexts in ubifs_lookup() Eric Biggers
2017-04-30  6:18   ` [4/4] " Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170407175840.95740-3-ebiggers3@gmail.com \
    --to=ebiggers3@gmail.com \
    --cc=ebiggers@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mhalcrow@google.com \
    --cc=richard@nod.at \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.