kernel_samsung_a53x/fs
Ryusuke Konishi 937418aa91 nilfs2: protect references to superblock parameters exposed in sysfs
[ Upstream commit 683408258917541bdb294cd717c210a04381931e ]

The superblock buffers of nilfs2 can not only be overwritten at runtime
for modifications/repairs, but they are also regularly swapped, replaced
during resizing, and even abandoned when degrading to one side due to
backing device issues.  So, accessing them requires mutual exclusion using
the reader/writer semaphore "nilfs->ns_sem".

Some sysfs attribute show methods read this superblock buffer without the
necessary mutual exclusion, which can cause problems with pointer
dereferencing and memory access, so fix it.

Link: https://lkml.kernel.org/r/20240811100320.9913-1-konishi.ryusuke@gmail.com
Fixes: da7141fb78db ("nilfs2: add /sys/fs/nilfs2/<device> group")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-19 00:09:58 +01:00
..
9p
adfs
affs
afs
autofs
befs
bfs
btrfs btrfs: don't set lock_owner when locking extent buffer for reading 2025-01-15 16:29:56 +01:00
cachefiles
ceph ceph: validate snapdirname option length when mounting 2025-01-15 16:29:47 +01:00
cifs cifs: Fix buffer overflow when parsing NFS reparse points 2024-12-17 13:23:58 +01:00
coda
configfs
cramfs
crypto
debugfs
devpts Import susfs4ksu 2025-01-18 21:48:58 +01:00
dlm
ecryptfs
efivarfs efivarfs: Fix error on non-existent file 2025-01-15 16:29:41 +01:00
efs
erofs erofs: fix incorrect symlink detection in fast symlink 2025-01-15 16:29:40 +01:00
exfat exfat: fix potential deadlock on __exfat_get_dentry_set 2025-01-02 17:00:49 +01:00
exportfs
ext2
ext4 fs: ext4: fsync: optimize double-fsync() a bunch 2025-01-16 22:01:03 +01:00
f2fs f2fs: fix f2fs_bug_on when uninstalling filesystem call f2fs_evict_inode. 2024-12-17 13:24:32 +01:00
fat Revert "fat: fix uninitialized variable" 2024-11-24 00:22:53 +01:00
freevxfs
fscache
fuse Revert "virtiofs: forbid newlines in tags" 2024-11-24 00:23:52 +01:00
gfs2
hfs
hfsplus hfsplus: don't query the device logical block size multiple times 2024-12-17 13:23:59 +01:00
hostfs
hpfs
hugetlbfs
incfs
iomap iomap: update ki_pos a little later in iomap_dio_complete 2024-11-23 23:22:00 +01:00
isofs
jbd2 Revert "ext4: fix incorrect tid assumption in __jbd2_log_wait_for_space()" 2024-11-24 00:23:04 +01:00
jffs2 jffs2: Fix rtime decompressor 2024-12-17 13:24:34 +01:00
jfs jfs: add a check to prevent array-index-out-of-bounds in dbAdjTree 2024-12-17 13:24:31 +01:00
kernfs
lockd Revert "nfsd: stop setting ->pg_stats for unused stats" 2024-11-24 00:23:44 +01:00
minix
nfs NFS/pnfs: Fix a live lock between recalled layouts and layoutget 2025-01-15 16:29:46 +01:00
nfs_common
nfsd nfsd: cancel nfsd_shrinker_work using sync mode in nfs4_state_shutdown_net 2025-01-15 16:29:52 +01:00
nilfs2 nilfs2: protect references to superblock parameters exposed in sysfs 2025-01-19 00:09:58 +01:00
nls
notify fsnotify: fix sending inotify event with unexpected filename 2024-12-17 13:24:18 +01:00
ntfs
ocfs2 ocfs2: update seq_file index in ocfs2_dlm_seq_next 2024-12-17 13:24:29 +01:00
omfs
openpromfs
orangefs
overlayfs Import susfs4ksu 2025-01-18 21:48:58 +01:00
proc Import susfs4ksu 2025-01-18 21:48:58 +01:00
pstore
qnx4
qnx6
quota quota: flush quota_release_work upon quota writeback 2024-12-17 13:24:23 +01:00
ramfs
reiserfs
romfs
sdfat fs: blkdev.c: Fix a typo 2024-12-18 18:20:04 +01:00
squashfs Revert "Squashfs: sanity check symbolic link size" 2024-11-24 00:23:38 +01:00
sysfs
sysv
tracefs
ubifs ubifs: authentication: Fix use-after-free in ubifs_tnc_end_commit 2024-12-17 13:24:21 +01:00
udf Revert "udf: Limit file size to 4TB" 2024-11-24 00:23:46 +01:00
ufs
unicode UPSTREAM: unicode: Don't special case ignorable code points 2025-01-19 00:09:58 +01:00
vboxsf
verity
xfs xfs: fix scrub tracepoints when inode-rooted btrees are involved 2025-01-02 17:00:49 +01:00
zonefs
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c
buffer.c
char_dev.c
compat_binfmt_elf.c
coredump.c
d_path.c
dax.c
dcache.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
dcookies.c
direct-io.c
dlog_hook.c
drop_caches.c
eventfd.c
eventpoll.c Revert "epoll: Add synchronous wakeup support for ep_poll_callback" 2025-01-15 16:38:29 +01:00
exec.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
fcntl.c Revert "fs: Fix file_set_fowner LSM hook inconsistencies" 2024-11-24 00:23:15 +01:00
fhandle.c
file.c
file_table.c
filesystems.c
fs-writeback.c
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fsopen.c
init.c
inode.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
internal.h
ioctl.c
Kconfig
Kconfig.binfmt
kernel_read_file.c
libfs.c
locks.c
Makefile Import susfs4ksu 2025-01-18 21:48:58 +01:00
mbcache.c
mount.h
mpage.c
namei.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
namespace.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
no-block.c
nsfs.c
open.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
read_write.c
readdir.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
remap_range.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
statfs.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
super.c Revert "fs: explicitly unregister per-superblock BDIs" 2024-11-24 00:23:31 +01:00
sus_su.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
susfs.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
sync.c
timerfd.c
userfaultfd.c
utimes.c
xattr.c