Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/ntfs3: Initialize new folios before use

KMSAN reports an uninitialized value in longest_match_std(), invoked
from ntfs_compress_write(). When new folios are allocated without being
marked uptodate and ni_read_frame() is skipped because the caller expects
the frame to be completely overwritten, some reserved folios may remain
only partially filled, leaving the rest memory uninitialized.

Fixes: 584f60ba22f7 ("ntfs3: Convert ntfs_get_frame_pages() to use a folio")
Tested-by: syzbot+08d8956768c96a2c52cf@syzkaller.appspotmail.com
Reported-by: syzbot+08d8956768c96a2c52cf@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=08d8956768c96a2c52cf

Signed-off-by: Bartlomiej Kubik <kubik.bartlomiej@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

authored by

Bartlomiej Kubik and committed by
Konstantin Komarov
f223ebff 1732053c

+1 -1
+1 -1
fs/ntfs3/file.c
··· 995 995 996 996 folio = __filemap_get_folio(mapping, index, 997 997 FGP_LOCK | FGP_ACCESSED | FGP_CREAT, 998 - gfp_mask); 998 + gfp_mask | __GFP_ZERO); 999 999 if (IS_ERR(folio)) { 1000 1000 while (npages--) { 1001 1001 folio = page_folio(pages[npages]);