From: Nirbhay Sharma Date: Mon, 6 Oct 2025 22:38:04 +0000 (+0530) Subject: fs/ntfs3: fix KMSAN uninit-value in ni_create_attr_list X-Git-Tag: v6.19-rc1~160^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f33da04e6ceee849e76e6592cc283c72fef7af9;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Konstantin Komarov --- diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index e441811855265..c3638f4823934 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -767,7 +767,7 @@ int ni_create_attr_list(struct ntfs_inode *ni) * Skip estimating exact memory requirement. * Looks like one record_size is always enough. */ - le = kmalloc(al_aligned(rs), GFP_NOFS); + le = kzalloc(al_aligned(rs), GFP_NOFS); if (!le) return -ENOMEM;