Skip to content

Commit f9417fc

Browse files
Qianqiang LiuAndreas Gruenbacher
authored andcommitted
KMSAN: uninit-value in inode_go_dump (5)
When mounting of a corrupted disk image fails, the error message printed can reference uninitialized inode fields. To prevent that from happening, always initialize those fields. Reported-by: syzbot+aa0730b0a42646eb1359@syzkaller.appspotmail.com Signed-off-by: Qianqiang Liu <qianqiang.liu@163.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 7c6f714 commit f9417fc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/gfs2/super.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,11 +1537,13 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb)
15371537
if (!ip)
15381538
return NULL;
15391539
ip->i_no_addr = 0;
1540+
ip->i_no_formal_ino = 0;
15401541
ip->i_flags = 0;
15411542
ip->i_gl = NULL;
15421543
gfs2_holder_mark_uninitialized(&ip->i_iopen_gh);
15431544
memset(&ip->i_res, 0, sizeof(ip->i_res));
15441545
RB_CLEAR_NODE(&ip->i_res.rs_node);
1546+
ip->i_diskflags = 0;
15451547
ip->i_rahead = 0;
15461548
return &ip->i_inode;
15471549
}

0 commit comments

Comments
 (0)