linux/fs/f2fs
Eric Biggers fc3bb095ab f2fs: avoid utf8_strncasecmp() with unstable name
If the dentry name passed to ->d_compare() fits in dentry::d_iname, then
it may be concurrently modified by a rename.  This can cause undefined
behavior (possibly out-of-bounds memory accesses or crashes) in
utf8_strncasecmp(), since fs/unicode/ isn't written to handle strings
that may be concurrently modified.

Fix this by first copying the filename to a stack buffer if needed.
This way we get a stable snapshot of the filename.

Fixes: 2c2eb7a300 ("f2fs: Support case-insensitive file name lookups")
Cc: <stable@vger.kernel.org> # v5.4+
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Daniel Rosenberg <drosen@google.com>
Cc: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-08 20:37:53 -07:00
..
acl.c f2fs: Replace spaces with tab 2019-05-08 21:23:11 -07:00
acl.h f2fs: Use the correct style for SPDX License Identifier 2020-05-08 06:55:55 -07:00
checkpoint.c f2fs: don't return vmalloc() memory from f2fs_kmalloc() 2020-06-08 20:34:58 -07:00
compress.c f2fs: compress: don't compress any datas after cp stop 2020-05-28 12:00:43 -07:00
data.c f2fs: fix retry logic in f2fs_write_cache_pages() 2020-06-04 11:45:09 -07:00
debug.c f2fs: show mounted time 2020-03-19 11:41:25 -07:00
dir.c f2fs: avoid utf8_strncasecmp() with unstable name 2020-06-08 20:37:53 -07:00
extent_cache.c f2fs: introduce f2fs_<level> macros to wrap f2fs_printk() 2019-07-02 15:40:40 -07:00
f2fs.h f2fs: don't return vmalloc() memory from f2fs_kmalloc() 2020-06-08 20:34:58 -07:00
file.c f2fs: protect new segment allocation in expand_inode_data 2020-05-28 12:00:43 -07:00
gc.c f2fs: add compressed/gc data read IO stat 2020-05-11 20:37:13 -07:00
gc.h f2fs: Use the correct style for SPDX License Identifier 2020-05-08 06:55:55 -07:00
hash.c f2fs: rework filename handling 2020-05-11 20:36:46 -07:00
inline.c f2fs: rework filename handling 2020-05-11 20:36:46 -07:00
inode.c f2fs: fix potential .flags overflow on 32bit architecture 2020-03-30 20:46:25 -07:00
Kconfig f2fs: compress: support lzo-rle compress algorithm 2020-05-11 20:36:46 -07:00
Makefile f2fs: support data compression 2020-01-17 16:48:07 -08:00
namei.c f2fs: fix wrong value of tracepoint parameter 2020-05-28 12:00:43 -07:00
node.c f2fs: don't return vmalloc() memory from f2fs_kmalloc() 2020-06-08 20:34:58 -07:00
node.h f2fs: shrink spinlock coverage 2020-05-11 20:36:46 -07:00
recovery.c f2fs: rework filename handling 2020-05-11 20:36:46 -07:00
segment.c f2fs: fix wrong discard space 2020-05-30 08:17:52 -07:00
segment.h f2fs: Use the correct style for SPDX License Identifier 2020-05-08 06:55:55 -07:00
shrinker.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
super.c f2fs: don't return vmalloc() memory from f2fs_kmalloc() 2020-06-08 20:34:58 -07:00
sysfs.c f2fs: add compressed/gc data read IO stat 2020-05-11 20:37:13 -07:00
trace.c f2fs: do not use mutex lock in atomic context 2019-03-05 19:58:06 -08:00
trace.h f2fs: Use the correct style for SPDX License Identifier 2020-05-08 06:55:55 -07:00
verity.c fs-verity: implement readahead of Merkle tree pages 2020-01-14 13:27:32 -08:00
xattr.c f2fs: use kmem_cache pool during inline xattr lookups 2020-03-22 21:16:27 -07:00
xattr.h f2fs: code cleanup by removing ifdef macro surrounding 2020-05-26 18:56:10 -07:00