linux_dsm_epyc7002/fs/ubifs
Eric Biggers 456fcfca6d ubifs: prevent creating duplicate encrypted filenames
commit 76786a0f083473de31678bdb259a3d4167cf756d upstream.

As described in "fscrypt: add fscrypt_is_nokey_name()", it's possible to
create a duplicate filename in an encrypted directory by creating a file
concurrently with adding the directory's encryption key.

Fix this bug on ubifs by rejecting no-key dentries in ubifs_create(),
ubifs_mkdir(), ubifs_mknod(), and ubifs_symlink().

Note that ubifs doesn't actually report the duplicate filenames from
readdir, but rather it seems to replace the original dentry with a new
one (which is still wrong, just a different effect from ext4).

On ubifs, this fixes xfstest generic/595 as well as the new xfstest I
wrote specifically for this bug.

Fixes: f4f61d2cc6 ("ubifs: Implement encrypted filenames")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20201118075609.120337-5-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-26 16:02:44 +01:00
..
auth.c ubifs: Fix 'hash' kernel-doc warning in auth.c 2020-09-17 23:06:53 +02:00
budget.c
commit.c
compress.c
crypto.c
debug.c ubifs: dent: Fix some potential memory leaks while iterating entries 2020-09-17 22:55:51 +02:00
debug.h
dir.c ubifs: prevent creating duplicate encrypted filenames 2020-12-26 16:02:44 +01:00
file.c
find.c
gc.c ubifs: Fix some kernel-doc warnings in gc.c 2020-09-17 23:06:53 +02:00
io.c
ioctl.c ubifs: setflags: Don't show error message when vfs_ioc_setflags_prepare() fails 2020-09-17 22:56:19 +02:00
journal.c ubifs: journal: Make sure to not dirty twice for auth nodes 2020-09-29 10:43:05 +02:00
Kconfig
key.h
log.c
lprops.c
lpt_commit.c
lpt.c
Makefile
master.c
misc.c
misc.h
orphan.c ubifs: xattr: Fix some potential memory leaks while iterating entries 2020-09-17 22:55:41 +02:00
recovery.c
replay.c ubifs: Fix some kernel-doc warnings in replay.c 2020-09-17 23:06:53 +02:00
sb.c
scan.c
shrinker.c
super.c This pull request contains changes for UBIFS 2020-10-18 09:51:10 -07:00
tnc_commit.c
tnc_misc.c
tnc.c This pull request contains fixes for UBI and UBIFS 2020-10-18 09:56:50 -07:00
ubifs-media.h
ubifs.h
xattr.c ubifs: xattr: Fix some potential memory leaks while iterating entries 2020-09-17 22:55:41 +02:00