Re: [PATCH] ntfs3: fix uninit memory after failed mi_read in mi_format_new

From: David Hunter

Date: Sun Sep 28 2025 - 11:17:30 EST


On 9/25/25 16:36, Raphael Pinsonneault-Thibeault wrote:
> attr_insert_range() called from ntfs_fallocate() has 2 different
> code paths that trigger mi_read() (which calls ntfs_read_bh).
> If the first mi_read() -> ntfs_read_bh() fails with an IO error, it
> leaves an uninitialized buffer in the buffer cache.
> The second mi_read() -> ntfs_read_bh() then uses that buffer,
> where we get KMSAN warning "uninit-value in ntfs_read_bh".
>
> The fix is to check if mi_read failed in mi_format_new.
>


Did you do any testing for this patch?

David Hunter