android_kernel_motorola_sm6375/fs/gfs2
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tuo Li b4a7ab57ef gfs2: Fix possible data races in gfs2_show_options()
[ Upstream commit 6fa0a72cbbe45db4ed967a51f9e6f4e3afe61d20 ]

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 <[email protected]>
Signed-off-by: Tuo Li <[email protected]>
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2023-08-30 16:27:10 +02:00
..
acl.c
acl.h
aops.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
aops.h
bmap.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
bmap.h
dentry.c
dir.c
dir.h
export.c
file.c
gfs2.h
glock.c gfs2: Fix use-after-free in gfs2_glock_shrink_scan 2021-06-18 09:58:59 +02:00
glock.h
glops.c gfs2: Fix inode height consistency check 2023-05-30 12:44:03 +01:00
glops.h
incore.h
inode.c
inode.h
Kconfig
lock_dlm.c gfs2: Don't call dlm after protocol is unmounted 2021-09-22 12:26:33 +02:00
log.c
log.h
lops.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
lops.h
main.c
Makefile
meta_io.c
meta_io.h
ops_fstype.c gfs2: Switch from strlcpy to strscpy 2022-11-25 17:42:22 +01:00
quota.c
quota.h
recovery.c
recovery.h
rgrp.c gfs2: assign rgrp glock before compute_bitstructs 2022-04-27 13:50:45 +02:00
rgrp.h
super.c gfs2: Fix possible data races in gfs2_show_options() 2023-08-30 16:27:10 +02:00
super.h
sys.c
sys.h
trace_gfs2.h
trans.c
trans.h
util.c
util.h
xattr.c
xattr.h