android_kernel_motorola_sm6375/fs/nilfs2
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryusuke Konishi e1fc4a90a9 nilfs2: protect access to buffers with no active references
commit 367a9bffabe08c04f6d725032cce3d891b2b9e1a upstream.

nilfs_lookup_dirty_data_buffers(), which iterates through the buffers
attached to dirty data folios/pages, accesses the attached buffers without
locking the folios/pages.

For data cache, nilfs_clear_folio_dirty() may be called asynchronously
when the file system degenerates to read only, so
nilfs_lookup_dirty_data_buffers() still has the potential to cause use
after free issues when buffers lose the protection of their dirty state
midway due to this asynchronous clearing and are unintentionally freed by
try_to_free_buffers().

Eliminate this race issue by adjusting the lock section in this function.

[konishi.ryusuke@gmail.com: adjusted for page/folio conversion]
Link: https://lkml.kernel.org/r/20250107200202.6432-3-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Fixes: 8c26c4e269 ("nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption")
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-13 12:43:18 +01:00
..
alloc.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-18 11:40:52 +02:00
alloc.h nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-18 11:40:52 +02:00
bmap.c
bmap.h
btnode.c nilfs2: fix null-ptr-deref in block_dirty_buffer tracepoint 2024-12-14 19:44:19 +01:00
btnode.h
btree.c nilfs2: fix potential oob read in nilfs_btree_check_delete() 2024-11-08 16:20:31 +01:00
btree.h
cpfile.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
cpfile.h
dat.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-18 11:40:52 +02:00
dat.h
dir.c nilfs2: handle errors that nilfs_prepare_chunk() may return 2025-03-13 12:43:04 +01:00
direct.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
direct.h
export.h
file.c nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() 2024-02-23 08:25:12 +01:00
gcinode.c nilfs2: fix null-ptr-deref in block_dirty_buffer tracepoint 2024-12-14 19:44:19 +01:00
ifile.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-18 11:40:52 +02:00
ifile.h
inode.c nilfs2: do not output warnings when clearing dirty buffers 2025-03-13 12:43:18 +01:00
ioctl.c nilfs2: fix out-of-range warning 2024-06-16 13:28:32 +02:00
Kconfig
Makefile
mdt.c nilfs2: do not output warnings when clearing dirty buffers 2025-03-13 12:43:18 +01:00
mdt.h
namei.c nilfs2: handle errors that nilfs_prepare_chunk() may return 2025-03-13 12:43:04 +01:00
nilfs.h nilfs2: handle errors that nilfs_prepare_chunk() may return 2025-03-13 12:43:04 +01:00
page.c nilfs2: do not force clear folio if buffer is referenced 2025-03-13 12:43:18 +01:00
page.h nilfs2: do not output warnings when clearing dirty buffers 2025-03-13 12:43:18 +01:00
recovery.c nilfs2: fix missing cleanup on rollforward recovery error 2024-09-12 11:03:51 +02:00
segbuf.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
segbuf.h
segment.c nilfs2: protect access to buffers with no active references 2025-03-13 12:43:18 +01:00
segment.h
sufile.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
sufile.h
super.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
sysfs.c nilfs2: protect references to superblock parameters exposed in sysfs 2024-09-12 11:03:56 +02:00
sysfs.h
the_nilfs.c nilfs2: fix inode number range checks 2024-07-18 11:40:51 +02:00
the_nilfs.h nilfs2: fix inode number range checks 2024-07-18 11:40:51 +02:00