linux/fs/f2fs
Eric Biggers aa4e216156 f2fs: report correct st_size for encrypted symlinks
commit 461b43a8f92e68e96c4424b31e15f2b35f1bbfa9 upstream.

The stat() family of syscalls report the wrong size for encrypted
symlinks, which has caused breakage in several userspace programs.

Fix this by calling fscrypt_symlink_getattr() after f2fs_getattr() for
encrypted symlinks.  This function computes the correct size by reading
and decrypting the symlink target (if it's not already cached).

For more details, see the commit which added fscrypt_symlink_getattr().

Fixes: cbaf042a3c ("f2fs crypto: add symlink encryption")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210702065350.209646-4-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-12 08:56:39 +02:00
..
Kconfig f2fs: Add a small clarification to CONFIG_FS_F2FS_FS_SECURITY 2019-09-16 08:38:48 -07:00
Makefile f2fs: add fs-verity support 2019-08-12 19:33:51 -07:00
acl.c f2fs: Replace spaces with tab 2019-05-08 21:23:11 -07:00
acl.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
checkpoint.c f2fs: avoid race condition for shrinker count 2021-01-06 14:48:40 +01:00
data.c f2fs: fix a wrong condition in __submit_bio 2021-03-04 10:26:24 +01:00
debug.c f2fs: avoid race condition for shrinker count 2021-01-06 14:48:40 +01:00
dir.c f2fs: fix uninit-value in f2fs_lookup 2020-11-05 11:43:13 +01:00
extent_cache.c f2fs: introduce f2fs_<level> macros to wrap f2fs_printk() 2019-07-02 15:40:40 -07:00
f2fs.h f2fs: avoid race condition for shrinker count 2021-01-06 14:48:40 +01:00
file.c f2fs: fix out-of-repair __setattr_copy() 2021-03-04 10:26:50 +01:00
gc.c f2fs: stop GC when the victim becomes fully valid 2020-10-01 13:17:21 +02:00
gc.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
hash.c f2fs: Support case-insensitive file name lookups 2019-08-23 07:57:13 -07:00
inline.c f2fs: fix a redundant call to f2fs_balance_fs if an error occurs 2021-05-19 10:08:25 +02:00
inode.c f2fs: fix to update time in lazytime mode 2020-01-04 19:16:31 +01:00
namei.c f2fs: report correct st_size for encrypted symlinks 2021-09-12 08:56:39 +02:00
node.c f2fs: fix to avoid out-of-bounds memory access 2021-05-11 14:04:14 +02:00
node.h f2fs: avoid race condition for shrinker count 2021-01-06 14:48:40 +01:00
recovery.c f2fs: fix error path in do_recover_data() 2020-09-03 11:26:45 +02:00
segment.c f2fs: handle errors of f2fs_get_meta_page_nofail 2020-11-05 11:43:14 +01:00
segment.h f2fs: handle unallocated section and zone on pinned/atgc 2021-03-07 12:20:46 +01:00
shrinker.c f2fs: avoid race condition for shrinker count 2021-01-06 14:48:40 +01:00
super.c f2fs: add MODULE_SOFTDEP to ensure crc32 is included in the initramfs 2021-07-20 16:10:49 +02:00
sysfs.c f2fs: Show casefolding support only when supported 2021-07-25 14:35:13 +02:00
trace.c f2fs: do not use mutex lock in atomic context 2019-03-05 19:58:06 -08:00
trace.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
verity.c f2fs: fix error handling in f2fs_end_enable_verity() 2021-05-19 10:08:32 +02:00
xattr.c f2fs: fix to avoid memory leakage in f2fs_listxattr 2020-04-29 16:32:55 +02:00
xattr.h f2fs: add fs-verity support 2019-08-12 19:33:51 -07:00