mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
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>
This commit is contained in:
parent
7c6f714d88
commit
f9417fcfca
|
|
@ -1537,11 +1537,13 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb)
|
|||
if (!ip)
|
||||
return NULL;
|
||||
ip->i_no_addr = 0;
|
||||
ip->i_no_formal_ino = 0;
|
||||
ip->i_flags = 0;
|
||||
ip->i_gl = NULL;
|
||||
gfs2_holder_mark_uninitialized(&ip->i_iopen_gh);
|
||||
memset(&ip->i_res, 0, sizeof(ip->i_res));
|
||||
RB_CLEAR_NODE(&ip->i_res.rs_node);
|
||||
ip->i_diskflags = 0;
|
||||
ip->i_rahead = 0;
|
||||
return &ip->i_inode;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user