]> Git Repo - linux.git/commitdiff
nilfs2: initialize "struct nilfs_binfo_dat"->bi_pad field
authorTetsuo Handa <[email protected]>
Sun, 26 Mar 2023 15:21:46 +0000 (00:21 +0900)
committerAndrew Morton <[email protected]>
Thu, 6 Apr 2023 01:06:23 +0000 (18:06 -0700)
nilfs_btree_assign_p() and nilfs_direct_assign_p() are not initializing
"struct nilfs_binfo_dat"->bi_pad field, causing uninit-value reports when
being passed to CRC function.

Link: https://lkml.kernel.org/r/[email protected]
Reported-by: syzbot <[email protected]>
Link: https://syzkaller.appspot.com/bug?extid=048585f3f4227bb2b49b
Reported-by: Dipanjan Das <[email protected]>
Link: https://lkml.kernel.org/r/CANX2M5bVbzRi6zH3PTcNE_31TzerstOXUa9Bay4E6y6dX23_pg@mail.gmail.com
Signed-off-by: Tetsuo Handa <[email protected]>
Signed-off-by: Ryusuke Konishi <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
fs/nilfs2/btree.c
fs/nilfs2/direct.c

index 2681a449edc162da2adee43f78e4e53dc9a2aa95..13592e82eaf68b2d92851e0218a99bd7842af9c4 100644 (file)
@@ -2219,6 +2219,7 @@ static int nilfs_btree_assign_p(struct nilfs_bmap *btree,
        /* on-disk format */
        binfo->bi_dat.bi_blkoff = cpu_to_le64(key);
        binfo->bi_dat.bi_level = level;
+       memset(binfo->bi_dat.bi_pad, 0, sizeof(binfo->bi_dat.bi_pad));
 
        return 0;
 }
index a35f2795b2422ffefc8a22b1892a557b146b2fc6..4c85914f2abc37a7d2ccb66115072196d3f60427 100644 (file)
@@ -314,6 +314,7 @@ static int nilfs_direct_assign_p(struct nilfs_bmap *direct,
 
        binfo->bi_dat.bi_blkoff = cpu_to_le64(key);
        binfo->bi_dat.bi_level = 0;
+       memset(binfo->bi_dat.bi_pad, 0, sizeof(binfo->bi_dat.bi_pad));
 
        return 0;
 }
This page took 0.06027 seconds and 4 git commands to generate.