2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
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
..
acl.c gfs2: convert to ctime accessor functions 2023-07-24 10:29:59 +02:00
acl.h gfs2: No longer use 'extern' in function declarations 2023-11-06 01:51:26 +01:00
aops.c gfs2: Don't start unnecessary transactions during log flush 2025-05-22 09:12:27 +02:00
aops.h gfs2: Don't start unnecessary transactions during log flush 2025-05-22 09:12:27 +02:00
bmap.c gfs2: Move gfs2_trans_add_databufs 2025-05-22 09:12:27 +02:00
bmap.h gfs2: No longer use 'extern' in function declarations 2023-11-06 01:51:26 +01:00
dentry.c gfs2_drevalidate(): use stable parent inode and name passed by caller 2025-01-27 19:25:24 -05:00
dir.c gfs2: Improve gfs2_consist_inode() usage 2024-04-09 18:35:57 +02:00
dir.h gfs2: No longer use 'extern' in function declarations 2023-11-06 01:51:26 +01:00
export.c exportfs: Remove EXPORT_OP_ASYNC_LOCK 2024-10-01 17:01:08 +02:00
file.c gfs2: some comment clarifications 2025-03-18 13:21:39 +01:00
gfs2.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 398 2019-06-05 17:37:12 +02:00
glock.c gfs2: replace sd_aspace with sd_inode 2025-04-21 18:20:36 +02:00
glock.h gfs2: Faster gfs2_upgrade_iopen_glock wakeups 2024-11-05 12:39:28 +01:00
glops.c gfs2: No more gfs2_find_jhead caching 2025-05-22 09:12:27 +02:00
glops.h gfs2: No longer use 'extern' in function declarations 2023-11-06 01:51:26 +01:00
incore.h gfs2: replace sd_aspace with sd_inode 2025-04-21 18:20:36 +02:00
inode.c gfs2: deallocate inodes in gfs2_create_inode 2025-04-24 23:10:05 +02:00
inode.h gfs2: Move gfs2_dinode_dealloc 2025-04-21 18:20:36 +02:00
Kconfig lib/crc: remove CONFIG_LIBCRC32C 2025-04-04 11:31:42 -07:00
lock_dlm.c gfs2: only apply DLM_LKF_VALBLK if sb_lvbptr is not NULL 2025-04-21 18:20:36 +02:00
log.c gfs2: Don't start unnecessary transactions during log flush 2025-05-22 09:12:27 +02:00
log.h gfs2: Move gfs2_log_pointers_init 2025-05-22 09:12:27 +02:00
lops.c gfs2: No more gfs2_find_jhead caching 2025-05-22 09:12:27 +02:00
lops.h gfs2: No more gfs2_find_jhead caching 2025-05-22 09:12:27 +02:00
main.c gfs2: use lockref_init for gl_lockref 2025-02-07 10:27:25 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
meta_io.c gfs2: replace sd_aspace with sd_inode 2025-04-21 18:20:36 +02:00
meta_io.h gfs2: replace sd_aspace with sd_inode 2025-04-21 18:20:36 +02:00
ops_fstype.c gfs2: Don't clear sb->s_fs_info in gfs2_sys_fs_add 2025-05-30 19:20:20 +02:00
quota.c lockref: remove count argument of lockref_init 2025-02-07 10:27:25 +01:00
quota.h gfs2: reorder capability check last 2024-12-09 10:44:35 +01:00
recovery.c gfs2: No more gfs2_find_jhead caching 2025-05-22 09:12:27 +02:00
recovery.h gfs2: Simplify gfs2_log_pointers_init 2025-05-22 09:12:27 +02:00
rgrp.c gfs2: Use get_random_u32 in gfs2_orlov_skip 2024-11-05 12:39:29 +01:00
rgrp.h gfs2: No longer use 'extern' in function declarations 2023-11-06 01:51:26 +01:00
super.c gfs2 changes 2025-05-26 12:35:08 -07:00
super.h gfs2 fixes 2023-11-07 11:54:17 -08:00
sys.c gfs2: Don't clear sb->s_fs_info in gfs2_sys_fs_add 2025-05-30 19:20:20 +02:00
sys.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 398 2019-06-05 17:37:12 +02:00
trace_gfs2.h gfs2: Fix additional unlikely request cancelation race 2025-03-10 18:15:38 +01:00
trans.c gfs2: Move gfs2_trans_add_databufs 2025-05-22 09:12:27 +02:00
trans.h gfs2: Move gfs2_trans_add_databufs 2025-05-22 09:12:27 +02:00
util.c gfs2: No more gfs2_find_jhead caching 2025-05-22 09:12:27 +02:00
util.h gfs2: gfs2_freeze_unlock cleanup 2024-04-29 12:35:15 +02:00
xattr.c gfs2: Move GIF_ALLOC_FAILED check out of gfs2_ea_dealloc 2025-04-21 18:20:36 +02:00
xattr.h gfs2: Move GIF_ALLOC_FAILED check out of gfs2_ea_dealloc 2025-04-21 18:20:36 +02:00