linux-stable/fs/fat
Jan Kara a276c595c3 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:58:08 +02:00
..
Kconfig VFAT/FAT/MSDOS FILESYSTEM: replace HTTP links with HTTPS ones 2020-08-12 10:58:01 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01: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 treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
fat.h fat: new inline functions to determine the FAT variant (32, 16 or 12) 2019-01-04 13:13:47 -08:00
fatent.c fat: add ratelimit to fat*_ent_bread() 2022-06-09 10:20:58 +02:00
file.c fatfs: switch write_lock to read_lock in fat_ioctl_get_attributes 2020-08-12 10:58:01 -07:00
inode.c [PATCH] reduce boilerplate in fsid handling 2020-09-18 16:45:50 -04:00
misc.c fs: fat: Eliminate timespec64_trunc() usage 2019-12-08 19:10:51 -05: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:58:08 +02:00