]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs/ntfs3: fix KMSAN uninit-value in ni_create_attr_list
authorNirbhay Sharma <nirbhay.lkd@gmail.com>
Mon, 6 Oct 2025 22:38:04 +0000 (04:08 +0530)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 10 Nov 2025 13:30:15 +0000 (14:30 +0100)
commit5f33da04e6ceee849e76e6592cc283c72fef7af9
tree4122fde177675874f25ffff0fb57ffefcaedec9b
parentbe99c62ac7e7af514e4b13f83c891a3cccefaa48
fs/ntfs3: fix KMSAN uninit-value in ni_create_attr_list

The call to kmalloc() to allocate the attribute list buffer is given a
size of al_aligned(rs). This size can be larger than the data
subsequently copied into the buffer, leaving trailing bytes uninitialized.

This can trigger a KMSAN "uninit-value" warning if that memory is
later accessed.

Fix this by using kzalloc() instead, which ensures the entire
allocated buffer is zero-initialized, preventing the warning.

Reported-by: syzbot+83c9dd5c0dcf6184fdbf@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=83c9dd5c0dcf6184fdbf
Signed-off-by: Nirbhay Sharma <nirbhay.lkd@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/frecord.c