sst-linux/fs
Chao Yu f4746f2d79 f2fs: get rid of online repaire on corrupted directory
[ Upstream commit 884ee6dc85b959bc152f15bca80c30f06069e6c4 ]

syzbot reports a f2fs bug as below:

kernel BUG at fs/f2fs/inode.c:896!
RIP: 0010:f2fs_evict_inode+0x1598/0x15c0 fs/f2fs/inode.c:896
Call Trace:
 evict+0x532/0x950 fs/inode.c:704
 dispose_list fs/inode.c:747 [inline]
 evict_inodes+0x5f9/0x690 fs/inode.c:797
 generic_shutdown_super+0x9d/0x2d0 fs/super.c:627
 kill_block_super+0x44/0x90 fs/super.c:1696
 kill_f2fs_super+0x344/0x690 fs/f2fs/super.c:4898
 deactivate_locked_super+0xc4/0x130 fs/super.c:473
 cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1373
 task_work_run+0x24f/0x310 kernel/task_work.c:228
 ptrace_notify+0x2d2/0x380 kernel/signal.c:2402
 ptrace_report_syscall include/linux/ptrace.h:415 [inline]
 ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
 syscall_exit_work+0xc6/0x190 kernel/entry/common.c:173
 syscall_exit_to_user_mode_prepare kernel/entry/common.c:200 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:205 [inline]
 syscall_exit_to_user_mode+0x279/0x370 kernel/entry/common.c:218
 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0010:f2fs_evict_inode+0x1598/0x15c0 fs/f2fs/inode.c:896

Online repaire on corrupted directory in f2fs_lookup() can generate
dirty data/meta while racing w/ readonly remount, it may leave dirty
inode after filesystem becomes readonly, however, checkpoint() will
skips flushing dirty inode in a state of readonly mode, result in
above panic.

Let's get rid of online repaire in f2fs_lookup(), and leave the work
to fsck.f2fs.

Fixes: 510022a858 ("f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries")
Reported-by: syzbot+ebea2790904673d7c618@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/000000000000a7b20f061ff2d56a@google.com
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-17 15:21:10 +02:00
..
9p 9P FS: Fix wild-memory-access write in v9fs_get_acl 2024-08-29 17:30:17 +02:00
adfs
affs
afs afs: fix __afs_break_callback() / afs_drop_open_mmap() race 2024-08-29 17:30:34 +02:00
autofs autofs: fix memory leak of waitqueues in autofs_catatonic_mode 2023-09-23 11:10:59 +02:00
befs
bfs
btrfs btrfs: calculate the right space for delayed refs when updating global reserve 2024-09-30 16:23:55 +02:00
cachefiles cachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie() 2024-07-25 09:49:21 +02:00
ceph ceph: fix incorrect kmalloc size of pagevec mempool 2024-08-03 08:49:52 +02:00
coda coda: Avoid partial allocation of sig_inputArgs 2023-03-10 09:33:52 +01:00
configfs
cramfs fs/cramfs/inode.c: initialize file_ra_state 2023-03-10 09:34:09 +01:00
crypto blk-crypto: add a blk_crypto_config_supported_natively helper 2023-05-11 23:03:00 +09:00
debugfs debugfs: fix automount d_fsdata usage 2024-01-20 11:50:04 +01:00
devpts
dlm fs: dlm: don't put dlm_local_addrs on heap 2024-02-16 19:06:29 +01:00
ecryptfs ecryptfs: Fix buffer size for tag 66 packet 2024-06-12 11:03:04 +02:00
efivarfs efivarfs: Request at most 512 bytes for variable names 2024-03-06 14:45:11 +00:00
efs
erofs erofs: avoid debugging output for (de)compressed data 2024-08-29 17:30:20 +02:00
exfat exfat: support handle zero-size directory 2023-11-28 17:07:00 +00:00
exportfs exportfs: use pr_debug for unreachable debug statements 2024-03-06 14:45:15 +00:00
ext2 ext2: Verify bitmap and itable block numbers before using them 2024-08-03 08:49:32 +02:00
ext4 ext4: avoid OOB when system.data xattr changes underneath the filesystem 2024-10-17 15:20:59 +02:00
f2fs f2fs: get rid of online repaire on corrupted directory 2024-10-17 15:21:10 +02:00
fat fat: fix uninitialized field in nostale filehandles 2024-04-03 15:19:27 +02:00
freevxfs
fscache fs/netfs/fscache_cookie: add missing "n_accesses" check 2024-08-29 17:30:15 +02:00
fuse fuse: add feature flag for expire-only 2024-09-12 11:10:30 +02:00
gfs2 gfs2: Remove freeze_go_demote_ok 2024-08-29 17:30:56 +02:00
hfs hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode() 2024-08-03 08:49:32 +02:00
hfsplus hfsplus: fix to avoid false alarm of circular locking 2024-08-03 08:48:53 +02:00
hostfs
hpfs
hugetlbfs mm/hugetlb: add hugetlb_folio_subpool() helpers 2024-05-17 11:55:51 +02:00
iomap iomap: Fix iomap_adjust_read_range for plen calculation 2024-07-25 09:49:12 +02:00
isofs isofs: handle CDs with bad root inode but good Joliet root directory 2024-04-13 13:05:06 +02:00
jbd2 ext4, jbd2: add an optimized bmap for the journal inode 2024-08-29 17:30:17 +02:00
jffs2 jffs2: Fix potential illegal address access in jffs2_free_inode 2024-07-11 12:47:09 +02:00
jfs jfs: fix out-of-bounds in dbNextAG() and diAlloc() 2024-10-17 15:20:52 +02:00
kernfs kernfs: fix false-positive WARN(nr_mmapped) in kernfs_drain_open_files 2024-08-29 17:30:35 +02:00
lockd nfsd: stop setting ->pg_stats for unused stats 2024-08-19 06:00:04 +02:00
minix
netfs netfs: Only call folio_start_fscache() one time for each folio 2023-10-06 14:56:32 +02:00
nfs NFS: Avoid unnecessary rescanning of the per-server delegation list 2024-09-18 19:23:03 +02:00
nfs_common
nfsd nfsd: return -EINVAL when namelen is 0 2024-10-17 15:21:08 +02:00
nilfs2 nilfs2: fix potential oob read in nilfs_btree_check_delete() 2024-10-17 15:21:00 +02:00
nls fs/nls: make load_nls() take a const parameter 2023-09-13 09:42:22 +02:00
notify fsnotify: clear PARENT_WATCHED flags lazily 2024-09-08 07:53:10 +02:00
ntfs
ntfs3 fs/ntfs3: Use kvfree to free memory allocated by kvmalloc 2024-09-18 19:23:04 +02:00
ocfs2 ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry() 2024-09-30 16:23:50 +02:00
omfs
openpromfs openpromfs: finish conversion to the new mount API 2024-06-12 11:03:03 +02:00
orangefs orangefs: fix out-of-bounds fsid access 2024-07-11 12:47:08 +02:00
overlayfs ovl: remove upper umask handling from ovl_create_upper() 2024-06-12 11:03:39 +02:00
proc sysctl: always initialize i_uid/i_gid 2024-08-11 12:35:51 +02:00
pstore pstore/zone: Add a null pointer check to the psz_kmsg_read 2024-04-13 13:04:57 +02:00
qnx4
qnx6
quota quota: Remove BUG_ON from dqget() 2024-08-29 17:30:34 +02:00
ramfs shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based tmpfs 2023-07-19 16:22:11 +02:00
reiserfs reiserfs: fix uninit-value in comp_keys 2024-08-29 17:30:20 +02:00
romfs
smb smb: client: fix hang in wait_for_response() for negproto 2024-09-30 16:23:49 +02:00
squashfs Squashfs: sanity check symbolic link size 2024-09-12 11:10:25 +02:00
sysfs fs: sysfs: Fix reference leak in sysfs_break_active_protection() 2024-04-27 17:07:16 +02:00
sysv sysv: don't call sb_bread() with pointers_lock held 2024-04-13 13:05:05 +02:00
tracefs tracefs: Add missing lockdown check to tracefs_create_dir() 2023-09-23 11:11:12 +02:00
ubifs ubifs: Set page uptodate in the correct place 2024-04-03 15:19:27 +02:00
udf udf: Avoid excessive partition lengths 2024-09-12 11:10:19 +02:00
ufs
unicode
vboxsf vboxsf: Avoid an spurious warning if load_nls_xxx() fails 2024-04-10 16:28:25 +02:00
verity fsverity: skip PKCS#7 parser when keyring is empty 2023-09-13 09:43:03 +02:00
xfs xfs: journal geometry is not properly bounds checked 2024-09-30 16:23:54 +02:00
zonefs zonefs: Improve error handling 2024-02-23 09:12:45 +01:00
aio.c fs/aio: Check IOCB_AIO_RW before the struct aio_kiocb conversion 2024-04-03 15:19:42 +02:00
anon_inodes.c
attr.c attr: block mode changes of symlinks 2023-09-23 11:11:10 +02:00
bad_inode.c
binfmt_elf_fdpic.c fs: binfmt_elf_efpic: don't use missing interpreter's properties 2024-08-29 17:30:35 +02:00
binfmt_elf_test.c
binfmt_elf.c ELF: fix kernel.randomize_va_space double read 2024-09-12 11:10:19 +02:00
binfmt_flat.c binfmt_flat: Fix corruption when not offsetting data start 2024-08-19 06:00:07 +02:00
binfmt_misc.c binfmt_misc: cleanup on filesystem umount 2024-08-29 17:30:30 +02:00
binfmt_script.c
buffer.c
char_dev.c
compat_binfmt_elf.c
coredump.c coredump: Move dump_emit_page() to kill unused warning 2023-02-22 12:59:50 +01:00
d_path.c
dax.c
dcache.c fs: better handle deep ancestor chains in is_subdir() 2024-07-25 09:49:18 +02:00
direct-io.c
drop_caches.c
eventfd.c eventfd: prevent underflow for eventfd semaphores 2023-09-13 09:42:27 +02:00
eventpoll.c epoll: be better about file lifetimes 2024-06-12 11:03:03 +02:00
exec.c exec: Fix ToCToU between perm check and set-uid/gid usage 2024-08-19 06:00:03 +02:00
fcntl.c fs: Fix rw_hint validation 2024-03-26 18:20:28 -04:00
fhandle.c do_sys_name_to_handle(): use kzalloc() to fix kernel-infoleak 2024-03-26 18:20:27 -04:00
file_table.c
file.c fix bitmap corruption on close_range() with CLOSE_RANGE_UNSHARE 2024-08-29 17:30:15 +02:00
filesystems.c
fs_context.c vfs, security: Fix automount superblock LSM init problem, preventing NFS sb sharing 2023-09-13 09:42:28 +02:00
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs 2023-11-20 11:51:50 +01:00
fsopen.c
init.c
inode.c vfs: Don't evict inode under the inode lru traversing context 2024-08-29 17:30:14 +02:00
internal.h nfs: use vfs setgid helper 2023-08-30 16:11:10 +02:00
ioctl.c lsm: new security_file_ioctl_compat() hook 2024-01-31 16:17:00 -08:00
Kconfig smb: move client and server files to common directory fs/smb 2023-06-28 11:12:40 +02:00
Kconfig.binfmt
kernel_read_file.c
libfs.c
locks.c filelock: Fix fcntl/close race recovery compat path 2024-07-27 11:32:19 +02:00
Makefile smb: move client and server files to common directory fs/smb 2023-06-28 11:12:40 +02:00
mbcache.c
mount.h
mpage.c
namei.c rename(): fix the locking of subdirectories 2024-01-31 16:17:02 -08:00
namespace.c mount: handle OOM on mnt_warn_timestamp_expiry 2024-10-17 15:20:37 +02:00
no-block.c
nsfs.c
open.c ftruncate: pass a signed offset 2024-07-05 09:31:59 +02:00
pipe.c fs/pipe: Fix lockdep false-positive in watchqueue pipe_write() 2024-04-10 16:28:30 +02:00
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
remap_range.c
select.c fs/select: rework stack allocation hack for clang 2024-03-26 18:20:28 -04:00
seq_file.c
signalfd.c
splice.c mm: merge folio_has_private()/filemap_release_folio() call pairs 2024-01-10 17:10:31 +01:00
stack.c
stat.c
statfs.c statfs: enforce statfs[64] structure initialization 2023-05-24 17:32:51 +01:00
super.c fs: don't allow non-init s_user_ns for filesystems without FS_USERNS_MOUNT 2024-08-03 08:49:53 +02:00
sync.c
sysctls.c
timerfd.c
userfaultfd.c Fix userfaultfd_api to return EINVAL as expected 2024-07-18 13:18:41 +02:00
utimes.c
xattr.c