]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ntfs3: fix uninit memory after failed mi_read in mi_format_new
authorRaphael Pinsonneault-Thibeault <rpthibeault@gmail.com>
Sun, 12 Oct 2025 20:16:34 +0000 (16:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:54:43 +0000 (13:54 +0100)
commit7ce8f2028dfccb2161b905cf8ab85cdd9e93909c
treeae4f556c89b71452a4f340b35ea397e6a8015d7e
parent752e578549ff116ed2d81a1d334f40b9fac7c034
ntfs3: fix uninit memory after failed mi_read in mi_format_new

[ Upstream commit 73e6b9dacf72a1e7a4265eacca46f8f33e0997d6 ]

Fix a KMSAN un-init bug found by syzkaller.

ntfs_get_bh() expects a buffer from sb_getblk(), that buffer may not be
uptodate. We do not bring the buffer uptodate before setting it as
uptodate. If the buffer were to not be uptodate, it could mean adding a
buffer with un-init data to the mi record. Attempting to load that record
will trigger KMSAN.

Avoid this by setting the buffer as uptodate, if it’s not already, by
overwriting it.

Reported-by: syzbot+7a2ba6b7b66340cff225@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7a2ba6b7b66340cff225
Tested-by: syzbot+7a2ba6b7b66340cff225@syzkaller.appspotmail.com
Fixes: 4342306f0f0d5 ("fs/ntfs3: Add file operations and implementation")
Signed-off-by: Raphael Pinsonneault-Thibeault <rpthibeault@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/fsntfs.c