linux-stable/fs/ocfs2
Joseph Qi 67bcecd780 ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger()
commit 685d03c379 upstream.

bdev->bd_super has been removed and commit 8887b94d93 change the usage
from bdev->bd_super to b_assoc_map->host->i_sb.  Since ocfs2 hasn't set
bh->b_assoc_map, it will trigger NULL pointer dereference when calling
into ocfs2_abort_trigger().

Actually this was pointed out in history, see commit 74e364ad1b.  But
I've made a mistake when reviewing commit 8887b94d93 and then
re-introduce this regression.

Since we cannot revive bdev in buffer head, so fix this issue by
initializing all types of ocfs2 triggers when fill super, and then get the
specific ocfs2 trigger from ocfs2_caching_info when access journal.

[joseph.qi@linux.alibaba.com: v2]
  Link: https://lkml.kernel.org/r/20240602112045.1112708-1-joseph.qi@linux.alibaba.com
Link: https://lkml.kernel.org/r/20240530110630.3933832-2-joseph.qi@linux.alibaba.com
Fixes: 8887b94d93 ("ocfs2: stop using bdev->bd_super for journal error logging")
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>	[6.6+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-27 13:49:12 +02:00
..
cluster ocfs2: cluster: fix potential deadlock on &o2net_debug_lock 2023-08-18 10:18:59 -07:00
dlm
dlmfs ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
acl.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
acl.h
alloc.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
alloc.h
aops.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
aops.h
blockcheck.c
blockcheck.h
buffer_head_io.c
buffer_head_io.h
dcache.c
dcache.h
dir.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
dir.h
dlmglue.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
dlmglue.h
export.c
export.h
extent_map.c
extent_map.h
file.c ocfs2: fix races between hole punching and AIO+DIO 2024-06-21 14:38:41 +02:00
file.h
filecheck.c
filecheck.h
heartbeat.c
heartbeat.h
inode.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
inode.h quota: Properly annotate i_dquot arrays with __rcu 2024-03-26 18:19:46 -04:00
ioctl.c ocfs2: reduce ioctl stack usage 2023-04-21 14:54:34 -07:00
ioctl.h
journal.c ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger() 2024-06-27 13:49:12 +02:00
journal.h ocfs2: use flexible array in 'struct ocfs2_recovery_map' 2023-08-18 10:18:57 -07:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
localalloc.c ocfs2: remove redundant assignment to variable bit_off 2023-06-23 17:04:04 -07:00
localalloc.h
locks.c
locks.h
Makefile
mmap.c
mmap.h
move_extents.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
move_extents.h
namei.c ocfs2: use coarse time for new created files 2024-06-21 14:38:41 +02:00
namei.h
ocfs1_fs_compat.h
ocfs2.h ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger() 2024-06-27 13:49:12 +02:00
ocfs2_fs.h
ocfs2_ioctl.h
ocfs2_lockid.h
ocfs2_lockingver.h
ocfs2_trace.h - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07:00
quota.h
quota_global.c
quota_local.c ocfs2: correct return value of ocfs2_local_free_info() 2023-06-09 17:44:22 -07:00
refcounttree.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
refcounttree.h
reservations.c
reservations.h
resize.c
resize.h
slot_map.c
slot_map.h
stack_o2cb.c
stack_user.c fs: dlm: fix F_CANCELLK to cancel pending request 2023-07-20 17:25:04 -05:00
stackglue.c
stackglue.h
suballoc.c
suballoc.h
super.c ocfs2: fix NULL pointer dereference in ocfs2_abort_trigger() 2024-06-27 13:49:12 +02:00
super.h
symlink.c
symlink.h
sysfile.c
sysfile.h
uptodate.c
uptodate.h
xattr.c ocfs2: convert to ctime accessor functions 2023-07-24 10:30:02 +02:00
xattr.h