linux-stable/fs/gfs2
Tuo Li a4f71523ed gfs2: Fix possible data races in gfs2_show_options()
[ Upstream commit 6fa0a72cbb ]

Some fields such as gt_logd_secs of the struct gfs2_tune are accessed
without holding the lock gt_spin in gfs2_show_options():

  val = sdp->sd_tune.gt_logd_secs;
  if (val != 30)
    seq_printf(s, ",commit=%d", val);

And thus can cause data races when gfs2_show_options() and other functions
such as gfs2_reconfigure() are concurrently executed:

  spin_lock(&gt->gt_spin);
  gt->gt_logd_secs = newargs->ar_commit;

To fix these possible data races, the lock sdp->sd_tune.gt_spin is
acquired before accessing the fields of gfs2_tune and released after these
accesses.

Further changes by Andreas:

- Don't hold the spin lock over the seq_printf operations.

Reported-by: BassCheck <bass@buaa.edu.cn>
Signed-off-by: Tuo Li <islituo@gmail.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-23 17:52:24 +02:00
..
acl.c
acl.h
aops.c gfs2: jdata writepage fix 2023-03-10 09:33:25 +01:00
aops.h
bmap.c gfs2: Always check inode size of inline inodes 2023-02-09 11:28:27 +01:00
bmap.h
dentry.c
dir.c gfs2 fixes 2022-08-06 14:44:49 -07:00
dir.h
export.c Change calling conventions for filldir_t 2022-08-17 17:25:04 -04:00
file.c gfs2: Fix duplicate should_fault_in_pages() call 2023-07-19 16:21:54 +02:00
gfs2.h
glock.c gfs2: Partially revert gfs2_inode_lookup change 2022-12-31 13:32:45 +01:00
glock.h gfs2: Merge branch 'for-next.nopid' into for-next 2022-10-09 22:56:28 +02:00
glops.c gfs2: Fix inode height consistency check 2023-05-24 17:32:37 +01:00
glops.h
incore.h gfs2: Make go_instantiate take a glock 2022-06-29 16:59:07 +02:00
inode.c gfs2: Merge branch 'for-next.nopid' into for-next 2022-10-09 22:56:28 +02:00
inode.h gfs2: Convert to release_folio 2022-05-09 23:12:33 -04:00
Kconfig
lock_dlm.c fs: dlm: remove DLM_LSFL_FS from uapi 2022-08-23 14:54:54 -05:00
log.c Revert "gfs2: stop using generic_writepages in gfs2_ail1_start_one" 2023-02-09 11:28:13 +01:00
log.h fs/gfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:32 -06:00
lops.c Folio changes for 6.0 2022-08-03 10:35:43 -07:00
lops.h fs/gfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:32 -06:00
main.c gfs2: Register fs after creating workqueues 2022-09-20 17:53:54 +02:00
Makefile
meta_io.c gfs2: replace ll_rw_block() 2022-09-11 20:26:06 -07:00
meta_io.h gfs2: Use container_of() for gfs2_glock(aspace) 2022-05-24 21:29:14 +02:00
ops_fstype.c gfs2: Merge branch 'for-next.nopid' into for-next 2022-10-09 22:56:28 +02:00
quota.c gfs2: replace ll_rw_block() 2022-09-11 20:26:06 -07:00
quota.h
recovery.c gfs2: replace 'found' with dedicated list iterator variable 2022-05-14 03:05:55 +02:00
recovery.h
rgrp.c Merge part of branch 'for-next.instantiate' into for-next 2022-08-05 18:37:03 +02:00
rgrp.h Merge part of branch 'for-next.instantiate' into for-next 2022-08-05 18:37:03 +02:00
super.c gfs2: Fix possible data races in gfs2_show_options() 2023-08-23 17:52:24 +02:00
super.h
sys.c
sys.h
trace_gfs2.h
trans.c
trans.h
util.c gfs2: Merge branch 'for-next.nopid' into for-next 2022-10-09 22:56:28 +02:00
util.h
xattr.c gfs2: Minor gfs2_glock_nq_m cleanup 2022-06-28 20:38:15 +02:00
xattr.h