Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1630050

[PATCH] ubifs: Correctly handle 0 value hashes in ubifs_lookup()

From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject [PATCH] ubifs: Correctly handle 0 value hashes in ubifs_lookup()
Date 2017-04-24 23:40 +0200
Message-ID <tzTSa-3S5-21@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Use fname_name(&nm) == NULL to detect whether a double hash
lookup should be performed instead of checking for nm.hash
being non-zero. zero is a valid hash value.

Fixes: f4f61d2cc6d8 ("ubifs: Implement encrypted filenames")
Cc: <stable@vger.kernel.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/ubifs/dir.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index b777bddaa1dd..ff77a0aa2f2b 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -249,9 +249,8 @@ static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry,
 		goto out_fname;
 	}
 
-	if (nm.hash) {
+	if (fname_name(&nm) == NULL) {
 		ubifs_assert(fname_len(&nm) == 0);
-		ubifs_assert(fname_name(&nm) == NULL);
 		dent_key_init_hash(c, &key, dir->i_ino, nm.hash);
 		err = ubifs_tnc_lookup_dh(c, &key, dent, nm.minor_hash);
 	} else {
-- 
2.7.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] ubifs: Correctly handle 0 value hashes in ubifs_lookup() Richard Weinberger <richard@nod.at> - 2017-04-24 23:40 +0200
  Re: [PATCH] ubifs: Correctly handle 0 value hashes in ubifs_lookup() Richard Weinberger <richard@nod.at> - 2017-04-24 23:50 +0200

csiph-web