linux/fs
Ryusuke Konishi 41e192ad27 nilfs2: fix kernel bug due to missing clearing of checked flag
Syzbot reported that in directory operations after nilfs2 detects
filesystem corruption and degrades to read-only,
__block_write_begin_int(), which is called to prepare block writes, may
fail the BUG_ON check for accesses exceeding the folio/page size,
triggering a kernel bug.

This was found to be because the "checked" flag of a page/folio was not
cleared when it was discarded by nilfs2's own routine, which causes the
sanity check of directory entries to be skipped when the directory
page/folio is reloaded.  So, fix that.

This was necessary when the use of nilfs2's own page discard routine was
applied to more than just metadata files.

Link: https://lkml.kernel.org/r/20241017193359.5051-1-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: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: syzbot+d6ca2daf692c7a82f959@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d6ca2daf692c7a82f959
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-10-28 21:40:40 -07:00
..
9p Revert patches causing inode collision problems 2024-10-25 15:25:02 -07:00
adfs
affs
afs afs: Fix lock recursion 2024-10-17 15:33:46 +02:00
autofs
bcachefs bcachefs fixes for 6.12-rc5 2024-10-24 12:38:59 -07:00
befs
bfs
btrfs for-6.12-rc4-tag 2024-10-24 13:04:15 -07:00
cachefiles
ceph
coda
configfs
cramfs
crypto
debugfs
devpts
dlm
ecryptfs
efivarfs
efs
erofs Changes since last update: 2024-10-14 11:12:09 -07:00
exfat
exportfs
ext2
ext4
f2fs f2fs: allow parallel DIO reads 2024-10-11 15:12:07 +00:00
fat fat: fix uninitialized variable 2024-10-17 00:28:06 -07:00
freevxfs
fuse fuse: remove stray debug line 2024-10-25 17:05:49 +02:00
gfs2
hfs
hfsplus
hostfs
hpfs
hugetlbfs
iomap iomap: move locking out of iomap_write_delalloc_release 2024-10-15 11:37:42 +02:00
isofs
jbd2
jffs2
jfs jfs: Fix sanity check in dbMount 2024-10-22 09:40:37 -05:00
kernfs
lockd
minix
netfs netfs: Downgrade i_rwsem for a buffered write 2024-10-17 15:33:42 +02:00
nfs NFS: remove revoked delegation from server's delegation list 2024-10-09 15:39:22 -04:00
nfs_common
nfsd nfsd-6.12 fixes: 2024-10-25 11:38:15 -07:00
nilfs2 nilfs2: fix kernel bug due to missing clearing of checked flag 2024-10-28 21:40:40 -07:00
nls
notify
ntfs3
ocfs2 ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow 2024-10-28 21:40:40 -07:00
omfs
openpromfs
orangefs
overlayfs fs: pass offset and result to backing_file end_write() callback 2024-10-16 13:17:45 +02:00
proc vfs-6.12-rc5.fixes 2024-10-21 10:48:24 -07:00
pstore
qnx4
qnx6
quota
ramfs
reiserfs
romfs
smb cifs: fix warning when destroy 'cifs_io_request_pool' 2024-10-23 07:42:44 -05:00
squashfs
sysfs
sysv
tests
tracefs
ubifs
udf
ufs
unicode unicode: Don't special case ignorable code points 2024-10-09 13:34:01 -04:00
vboxsf
verity
xfs xfs: update the pag for the last AG at recovery time 2024-10-22 13:37:19 +02:00
zonefs
aio.c
anon_inodes.c
attr.c
backing-file.c fs: pass offset and result to backing_file end_write() callback 2024-10-16 13:17:45 +02:00
bad_inode.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
bpf_fs_kfuncs.c
buffer.c
char_dev.c
compat_binfmt_elf.c
coredump.c
d_path.c
dax.c
dcache.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
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 bcachefs: do not use PF_MEMALLOC_NORECLAIM 2024-10-09 12:47:18 -07:00
internal.h
ioctl.c
Kconfig
Kconfig.binfmt
kernel_read_file.c
libfs.c
locks.c
Makefile
mbcache.c
mnt_idmapping.c
mount.h
mpage.c
namei.c
namespace.c fs: don't try and remove empty rbtree node 2024-10-17 15:33:43 +02:00
nsfs.c
open.c openat2: explicitly return -E2BIG for (usize > PAGE_SIZE) 2024-10-10 12:09:03 +02:00
pidfs.c
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
remap_range.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c
sync.c
sysctls.c
timerfd.c
userfaultfd.c fork: do not invoke uffd on fork if error occurs 2024-10-28 21:40:38 -07:00
utimes.c
xattr.c