linux/fs/fat
Jan Kara c8cc05de8e fat: fix uninitialized field in nostale filehandles
[ Upstream commit fde2497d2b ]

When fat_encode_fh_nostale() encodes file handle without a parent it
stores only first 10 bytes of the file handle. However the length of the
file handle must be a multiple of 4 so the file handle is actually 12
bytes long and the last two bytes remain uninitialized. This is not
great at we potentially leak uninitialized information with the handle
to userspace. Properly initialize the full handle length.

Link: https://lkml.kernel.org/r/20240205122626.13701-1-jack@suse.cz
Reported-by: syzbot+3ce5dea5b1539ff36769@syzkaller.appspotmail.com
Fixes: ea3983ace6 ("fat: restructure export_operations")
Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:19:27 +02:00
..
.kunitconfig fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
cache.c fat: new inline functions to determine the FAT variant (32, 16 or 12) 2019-01-04 13:13:47 -08:00
dir.c Change calling conventions for filldir_t 2022-08-17 17:25:04 -04:00
fat_test.c fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
fat.h fat: remove time truncations in vfat_create/vfat_mkdir 2022-05-19 14:10:31 -07:00
fatent.c fat: add ratelimit to fat*_ent_bread() 2022-04-29 14:38:02 -07:00
file.c fat: port to vfs{g,u}id_t and associated helpers 2022-09-20 11:09:31 +02:00
inode.c treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
Kconfig fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
Makefile fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
misc.c fat: remove time truncations in vfat_create/vfat_mkdir 2022-05-19 14:10:31 -07:00
namei_msdos.c fat: handle idmapped mounts 2021-01-24 14:43:46 +01:00
namei_vfat.c fat: add renameat2 RENAME_EXCHANGE flag support 2022-06-16 19:58:22 -07:00
nfs.c fat: fix uninitialized field in nostale filehandles 2024-04-03 15:19:27 +02:00