Skip to content

Commit f223ebf

Browse files
Bartekkubikaalexandrovich
authored andcommitted
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: 584f60b ("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>
1 parent 1732053 commit f223ebf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ntfs3/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ static int ntfs_get_frame_pages(struct address_space *mapping, pgoff_t index,
995995

996996
folio = __filemap_get_folio(mapping, index,
997997
FGP_LOCK | FGP_ACCESSED | FGP_CREAT,
998-
gfp_mask);
998+
gfp_mask | __GFP_ZERO);
999999
if (IS_ERR(folio)) {
10001000
while (npages--) {
10011001
folio = page_folio(pages[npages]);

0 commit comments

Comments
 (0)