Commit 4ec96a85 authored by Jan Kara's avatar Jan Kara Committed by Yifan Qiao
Browse files

fat: fix uninitialized field in nostale filehandles

stable inclusion
from stable-v6.8.3
commit cdd33d54e789d229d6d5007cbf3f53965ca1a5c6
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9L5QJ
CVE: CVE-2024-26973

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cdd33d54e789d229d6d5007cbf3f53965ca1a5c6

--------------------------------

[ 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: default avatar <syzbot+3ce5dea5b1539ff36769@syzkaller.appspotmail.com>
Fixes: ea3983ac ("fat: restructure export_operations")
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYifan Qiao <qiaoyifan4@huawei.com>
parent 48d72040
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment