linux-stable/fs/gfs2
Tuo Li 42077d4de4 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:32:31 +02:00
..
acl.c fs: port acl to mnt_idmap 2023-01-19 09:24:28 +01:00
acl.h fs: port ->set_acl() to pass mnt_idmap 2023-01-19 09:24:27 +01:00
aops.c - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
aops.h gfs2: Convert gfs2_page_add_databufs to folios 2023-02-22 12:06:20 +01:00
bmap.c gfs2: Eliminate gfs2_trim_blocks 2023-04-18 14:40:12 +02:00
bmap.h gfs2: Eliminate gfs2_trim_blocks 2023-04-18 14:40:12 +02:00
dentry.c Reinstate "GFS2: free disk inode which is deleted by remote node -V2" 2023-03-23 19:37:56 +01:00
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:36:34 +02:00
gfs2.h
glock.c gfs2: Cease delete work during unmount 2023-01-31 22:40:24 +01:00
glock.h gfs2: Split the two kinds of glock "delete" work 2023-01-31 22:40:24 +01:00
glops.c gfs2: gfs2_ail_empty_gl no log flush on error 2023-04-25 11:07:16 +02:00
glops.h
incore.h gfs2: Evict inodes cooperatively 2023-01-31 22:40:24 +01:00
inode.c gfs2: Remove ghs[] from gfs2_unlink 2023-03-27 14:42:16 +02:00
inode.h fs: port ->permission() to pass mnt_idmap 2023-01-19 09:24:28 +01:00
Kconfig
lock_dlm.c fs: dlm: remove DLM_LSFL_FS from uapi 2022-08-23 14:54:54 -05:00
log.c - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08: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 obvious uses of b_page with b_folio 2023-01-18 17:12:40 -08:00
meta_io.h gfs2: Use container_of() for gfs2_glock(aspace) 2022-05-24 21:29:14 +02:00
ops_fstype.c gfs2: Use gfs2_holder_initialized for jindex 2023-04-18 14:46:16 +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 gfs2: Split the two kinds of glock "delete" work 2023-01-31 22:40:24 +01: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:32:31 +02:00
super.h gfs2: Don't release and reacquire local statfs bh 2021-08-20 09:03:46 -05:00
sys.c Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
sys.h
trace_gfs2.h gfs2: Remove 'first' trace_gfs2_promote argument 2021-10-25 08:42:19 +02:00
trans.c gfs2: fix use-after-free in trans_drain 2021-03-07 17:04:55 +01:00
trans.h Merge branches 'rgrp-glock-sharing' and 'gfs2-revoke' from https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git 2021-02-23 18:54:22 +01:00
util.c gfs2: Merge branch 'for-next.nopid' into for-next 2022-10-09 22:56:28 +02:00
util.h gfs2: don't stop reads while withdraw in progress 2021-08-20 09:03:46 -05:00
xattr.c fs: drop unused posix acl handlers 2023-03-06 09:57:12 +01:00
xattr.h