linux-stable/fs/fat
Jan Kara f52d7663a1 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-13 12:51:23 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
cache.c
dir.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
fat.h
fatent.c fat: add ratelimit to fat*_ent_bread() 2022-06-14 18:11:30 +02:00
file.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
inode.c fat: don't allow to mount if the FAT length == 0 2020-06-17 16:40:36 +02:00
misc.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
namei_msdos.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
namei_vfat.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
nfs.c fat: fix uninitialized field in nostale filehandles 2024-04-13 12:51:23 +02:00