diff options
author | Qianqiang Liu <qianqiang.liu@163.com> | 2024-10-21 22:58:01 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2024-10-22 14:06:11 +0200 |
commit | f9417fcfca3c5e30a0b961e7250fab92cfa5d123 (patch) | |
tree | 4b0b211eb4befa1fde8c6d6387f753c99c14f652 /fs/gfs2 | |
parent | 7c6f714d88475ceae5342264858a641eafa19632 (diff) | |
download | linux-f9417fcfca3c5e30a0b961e7250fab92cfa5d123.tar.gz linux-f9417fcfca3c5e30a0b961e7250fab92cfa5d123.tar.bz2 linux-f9417fcfca3c5e30a0b961e7250fab92cfa5d123.zip |
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>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index e22c1edc32b3..b9cef63c7871 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -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; } |