Files
linux/fs/gfs2
Andrew Price 9126d2754c gfs2: Don't clear sb->s_fs_info in gfs2_sys_fs_add
When gfs2_sys_fs_add() fails, it sets sb->s_fs_info to NULL on its error
path (see commit 0d515210b6 ("GFS2: Add kobject release method")).
The intention seems to be to prevent dereferencing sb->s_fs_info once
the object pointed to has been deallocated, but that would be better
achieved by setting the pointer to NULL in free_sbd().

As a consequence, when the call to gfs2_sys_fs_add() fails in
gfs2_fill_super(), sdp = GFS2_SB(inode) will evaluate to NULL in iput()
-> gfs2_drop_inode(), and accessing sdp->sd_flags will be a NULL pointer
dereference.

Fix that by only setting sb->s_fs_info to NULL when actually freeing the
object pointed to in free_sbd().

Fixes: ae9f3bd825 ("gfs2: replace sd_aspace with sd_inode")
Reported-by: syzbot+b12826218502df019f9d@syzkaller.appspotmail.com
Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
2025-05-30 19:20:20 +02:00
..
2025-05-22 09:12:27 +02:00
2024-04-09 18:35:57 +02:00
2024-10-01 17:01:08 +02:00
2025-03-18 13:21:39 +01:00
2025-04-21 18:20:36 +02:00
2025-05-22 09:12:27 +02:00
2025-04-21 18:20:36 +02:00
2025-04-21 18:20:36 +02:00
2025-04-04 11:31:42 -07:00
2025-05-22 09:12:27 +02:00
2025-05-22 09:12:27 +02:00
2025-05-22 09:12:27 +02:00
2025-02-07 10:27:25 +01:00
2024-12-09 10:44:35 +01:00
2025-05-22 09:12:27 +02:00
2025-05-22 09:12:27 +02:00
2025-05-22 09:12:27 +02:00
2024-04-29 12:35:15 +02:00