nilfs_direct_assign_p() from nilfs_direct_assign() from nilfs_bmap_assign() is not initializing "struct nilfs_binfo_dat"->bi_pad field. We need to initialize sizeof("union nilfs_binfo"->bi_dat) bytes if nilfs_write_dat_node_binfo() from nilfs_segctor_assign() copies it and nilfs_add_checksums_on_logs() passes it to CRC function. Link: https://syzkaller.appspot.com/bug?extid=048585f3f4227bb2b49b Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> --- Changes in v2: Use memset() for initialization, suggested by Ryusuke Konishi. fs/nilfs2/direct.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nilfs2/direct.c b/fs/nilfs2/direct.c index a35f2795b242..4c85914f2abc 100644 --- a/fs/nilfs2/direct.c +++ b/fs/nilfs2/direct.c @@ -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; } -- 2.34.1