WSL2-Linux-Kernel/fs/fat
Jan Kara b7fb63e807 fat: fix uninitialized field in nostale filehandles
[ Upstream commit fde2497d2bc3a063d8af88b258dbadc86bd7b57c ]

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-10 16:18:35 +02:00
..
.kunitconfig fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -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
cache.c
dir.c
fat.h fs: make helpers idmap mount aware 2021-01-24 14:27:20 +01:00
fat_test.c fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
fatent.c fat: add ratelimit to fat*_ent_bread() 2022-06-09 10:22:42 +02:00
file.c idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
inode.c mm: require ->set_page_dirty to be explicitly wired up 2021-06-29 10:53:48 -07:00
misc.c fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
namei_msdos.c fat: handle idmapped mounts 2021-01-24 14:43:46 +01:00
namei_vfat.c fat: handle idmapped mounts 2021-01-24 14:43:46 +01:00
nfs.c fat: fix uninitialized field in nostale filehandles 2024-04-10 16:18:35 +02:00