Jaegeuk Kim
4c7f9d9f28
f2fs: handle errors of f2fs_get_meta_page_nofail
...
First problem is we hit BUG_ON() in f2fs_get_sum_page given EIO on
f2fs_get_meta_page_nofail().
Quick fix was not to give any error with infinite loop, but syzbot caught
a case where it goes to that loop from fuzzed image. In turned out we abused
f2fs_get_meta_page_nofail() like in the below call stack.
- f2fs_fill_super
- f2fs_build_segment_manager
- build_sit_entries
- get_current_sit_page
INFO: task syz-executor178:6870 can't die for more than 143 seconds.
task:syz-executor178 state:R
stack:26960 pid: 6870 ppid: 6869 flags:0x00004006
Call Trace:
Showing all locks held in the system:
1 lock held by khungtaskd/1179:
#0 : ffffffff8a554da0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6242
1 lock held by systemd-journal/3920:
1 lock held by in:imklog/6769:
#0 : ffff88809eebc130 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe9/0x100 fs/file.c:930
1 lock held by syz-executor178/6870:
#0 : ffff8880925120e0 (&type->s_umount_key#47/1){+.+.}-{3:3}, at: alloc_super+0x201/0xaf0 fs/super.c:229
Actually, we didn't have to use _nofail in this case, since we could return
error to mount(2) already with the error handler.
As a result, this patch tries to 1) remove _nofail callers as much as possible,
2) deal with error case in last remaining caller, f2fs_get_sum_page().
Change-Id: I886e51597190332553b6a6bbd9fa474f4995bac6
Reported-by: [email protected]
Reviewed-by: Chao Yu <[email protected] >
Signed-off-by: Jaegeuk Kim <[email protected] >
Git-commit: 86f33603f8c51537265ff7ac0320638fd2cbdb1b
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux.git/
Signed-off-by: Sayali Lokhande <[email protected] >
2020-10-15 11:12:42 +05:30
..
9p
This is the 5.4.59 stable release
2020-08-19 08:40:57 +02:00
adfs
affs
affs: fix a memory leak in affs_remount
2020-01-17 19:48:50 +01:00
afs
This is the 5.4.61 stable release
2020-08-26 11:11:38 +02:00
autofs
autofs: fix a leak in autofs_expire_indirect()
2019-10-25 00:03:11 -04:00
befs
bfs
btrfs
This is the 5.4.61 stable release
2020-08-26 11:11:38 +02:00
cachefiles
cachefiles: Fix race between read_waiter and read_copier involving op->to_do
2020-06-03 08:21:11 +02:00
ceph
This is the 5.4.61 stable release
2020-08-26 11:11:38 +02:00
cifs
Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4"
2020-08-23 13:12:51 +02:00
coda
configfs
configfs: fix config_item refcnt leak in configfs_rmdir()
2020-05-27 17:46:30 +02:00
cramfs
cramfs: fix usage on non-MTD device
2019-11-23 21:44:49 -05:00
crypto
ANDROID: fscrypt: fix DUN contiguity with inline encryption + IV_INO_LBLK_32 policies
2020-07-14 15:48:10 +00:00
debugfs
debugfs: Check module state before warning in {full/open}_proxy_open()
2020-04-17 10:50:02 +02:00
devpts
dlm
dlm: Fix kobject memleak
2020-08-19 08:16:21 +02:00
ecryptfs
This is the 5.4.23 stable release
2020-03-01 10:17:44 +01:00
efivarfs
efs
erofs
This is the 5.4.59 stable release
2020-08-19 08:40:57 +02:00
exportfs
exportfs_decode_fh(): negative pinned may become positive without the parent locked
2019-11-10 11:56:05 -05:00
ext2
Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4"
2020-08-23 13:12:51 +02:00
ext4
This is the 5.4.61 stable release
2020-08-26 11:11:38 +02:00
f2fs
f2fs: handle errors of f2fs_get_meta_page_nofail
2020-10-15 11:12:42 +05:30
fat
fat: don't allow to mount if the FAT length == 0
2020-06-17 16:40:36 +02:00
freevxfs
fscache
fuse
This is the 5.4.54 stable release
2020-07-29 13:27:01 +02:00
gfs2
This is the 5.4.61 stable release
2020-08-26 11:11:38 +02:00
hfs
FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr
2019-11-05 13:50:57 -08:00
hfsplus
This is the 5.4.33 stable release
2020-04-17 11:26:58 +02:00
hostfs
hpfs
hugetlbfs
Merge android-5.4.24 ( ce5de62) into msm-5.4
2020-04-14 08:25:29 -07:00
incfs
ANDROID: Incremental fs: fix magic compatibility again
2020-08-26 14:05:41 +00:00
iomap
Merge android-5.4.8 ( de197c5) into msm-5.4
2020-03-06 19:19:20 -08:00
isofs
jbd2
jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock()
2020-08-26 10:40:52 +02:00
jffs2
This is the 5.4.61 stable release
2020-08-26 11:11:38 +02:00
jfs
FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr
2019-11-05 13:50:57 -08:00
kernfs
This is the 5.4.59 stable release
2020-08-19 08:40:57 +02:00
lockd
minix
Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4"
2020-08-23 13:12:51 +02:00
nfs
Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4"
2020-08-23 13:12:51 +02:00
nfs_common
nfsd
nfsd: Fix NFSv4 READ on RDMA when using readv
2020-08-11 15:33:42 +02:00
nilfs2
nilfs2: fix null pointer dereference at nilfs_segctor_do_construct()
2020-06-17 16:40:29 +02:00
nls
notify
fanotify: fix ignore mask logic for events on child and on dir
2020-06-17 16:40:24 +02:00
ntfs
utimes: Clamp the timestamps in notify_change()
2020-02-11 04:35:12 -08:00
ocfs2
Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4"
2020-08-23 13:12:51 +02:00
omfs
openpromfs
orangefs
Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4"
2020-08-23 13:12:51 +02:00
overlayfs
This is the 5.4.53 stable release
2020-07-23 12:36:54 +02:00
proc
FROMGIT: mm, oom_adj: don't loop through tasks in __set_oom_adj when not necessary
2020-09-16 09:56:55 -07:00
pstore
Merge "pstore: Register pstore reserved memory into Minidump"
2020-09-09 15:28:45 -07:00
qnx4
qnx6
quota
fs: avoid softlockups in s_inodes iterators
2020-01-12 12:21:37 +01:00
ramfs
reiserfs
This is the 5.4.22 stable release
2020-02-24 09:16:10 +01:00
romfs
romfs: fix uninitialized memory leak in romfs_dev_read()
2020-08-26 10:40:51 +02:00
squashfs
FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr
2019-11-05 13:50:57 -08:00
sysfs
sysv
tracefs
tracing: Do not create tracefs files if tracefs lockdown is in effect
2019-10-12 20:49:07 -04:00
ubifs
Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4"
2020-08-23 13:12:51 +02:00
udf
udf: Fix free space reporting for metadata and virtual partitions
2020-02-24 08:36:44 +01:00
ufs
Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4"
2020-08-23 13:12:51 +02:00
unicode
FROMLIST: unicode: Add utf8_casefold_hash
2020-02-20 21:21:02 +00:00
verity
fs-verity: remove unnecessary extern keywords
2020-06-16 14:06:46 -07:00
xfs
This is the 5.4.61 stable release
2020-08-26 11:11:38 +02:00
aio.c
aio: fix async fsync creds
2020-06-17 16:40:24 +02:00
anon_inodes.c
attr.c
Revert "ANDROID: vfs: Add setattr2 for filesystems with per mount permissions"
2020-05-29 14:48:38 +02:00
bad_inode.c
binfmt_aout.c
binfmt_elf.c
fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
2020-06-03 08:21:27 +02:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c
block: Fix use-after-free in blkdev_get()
2020-06-24 17:50:47 +02:00
buffer.c
Merge android-5.4-stable.45 ( a9a13ee) into msm-5.4
2020-07-09 17:51:24 -07:00
char_dev.c
chardev: Avoid potential use-after-free in 'chrdev_open()'
2020-01-14 20:08:18 +01:00
compat.c
compat_binfmt_elf.c
compat_ioctl.c
fix compat handling of FICLONERANGE, FIDEDUPERANGE and FS_IOC_FIEMAP
2020-01-09 10:20:05 +01:00
coredump.c
Revert "ANDROID: vfs: Add setattr2 for filesystems with per mount permissions"
2020-05-29 14:48:38 +02:00
d_path.c
dax.c
dax: pass NOWAIT flag to iomap_apply
2020-03-05 16:43:36 +01:00
dcache.c
dcookies.c
direct-io.c
ANDROID: fscrypt: handle direct I/O with IV_INO_LBLK_32
2020-05-21 11:52:18 -07:00
drop_caches.c
fs: avoid softlockups in s_inodes iterators
2020-01-12 12:21:37 +01:00
eventfd.c
eventfd: track eventfd_signal() recursion depth
2020-02-11 04:35:37 -08:00
eventpoll.c
This is the 5.4.61 stable release
2020-08-26 11:11:38 +02:00
exec.c
Revert "ANDROID: vfs: Add permission2 for filesystems with per mount permissions"
2020-05-29 14:48:37 +02:00
fcntl.c
fhandle.c
file.c
fix multiplication overflow in copy_fdtable()
2020-05-27 17:46:12 +02:00
file_table.c
filesystems.c
fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once()
2020-04-17 10:50:21 +02:00
fs-writeback.c
Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable
2020-06-24 11:13:19 -07:00
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
Revert "ANDROID: sdcardfs: Enable modular sdcardfs"
2020-05-29 15:08:00 +02:00
fs_types.c
fsopen.c
inode.c
Revert "ANDROID: vfs: Add setattr2 for filesystems with per mount permissions"
2020-05-29 14:48:38 +02:00
internal.h
Revert "ANDROID: fs: Restore vfs_path_lookup() export"
2020-05-29 14:48:37 +02:00
io_uring.c
io_uring: Fix NULL pointer dereference in loop_rw_iter()
2020-08-19 08:16:29 +02:00
ioctl.c
compat_ioctl: add compat_ptr_ioctl()
2019-12-17 19:55:30 +01:00
Kconfig
ANDROID: sdcardfs: remove sdcardfs from system
2020-05-29 14:48:37 +02:00
Kconfig.binfmt
libfs.c
Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable
2020-06-15 13:22:44 -07:00
locks.c
locks: reinstate locks_delete_block optimization
2020-03-25 08:25:41 +01:00
Makefile
ANDROID: GKI: set vfs-only exports into their own namespace
2020-07-07 18:07:10 +02:00
mbcache.c
mount.h
mpage.c
This is the 5.4.13 stable release
2020-01-17 23:38:39 +01:00
namei.c
ANDROID: GKI: set vfs-only exports into their own namespace
2020-07-07 18:07:10 +02:00
namespace.c
Linux 5.4-rc8
2019-11-18 08:31:11 +01:00
no-block.c
nsfs.c
open.c
ANDROID: GKI: set vfs-only exports into their own namespace
2020-07-07 18:07:10 +02:00
pipe.c
pnode.c
This is the 5.4.37 stable release
2020-05-02 09:01:51 +02:00
pnode.h
posix_acl.c
FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr
2019-11-05 13:50:57 -08:00
proc_namespace.c
Merge 5.4-rc1-prelrease into android-mainline
2019-10-02 17:58:47 +02:00
read_write.c
ANDROID: GKI: set vfs-only exports into their own namespace
2020-07-07 18:07:10 +02:00
readdir.c
readdir: be more conservative with directory entry names
2020-01-29 16:45:31 +01:00
select.c
seq_file.c
signalfd.c
fs/signalfd.c: fix inconsistent return codes for signalfd4
2020-08-26 10:40:58 +02:00
splice.c
splice: only read in as much information as there is pipe buffer space
2019-12-17 19:56:52 +01:00
stack.c
stat.c
ANDROID: GKI: set vfs-only exports into their own namespace
2020-07-07 18:07:10 +02:00
statfs.c
vfs: Fix EOVERFLOW testing in put_compat_statfs64
2019-10-03 14:21:35 -07:00
super.c
Fix use after free in get_tree_bdev()
2020-05-06 08:15:15 +02:00
sync.c
timerfd.c
userfaultfd.c
mm: protect VMA modifications using VMA sequence count
2020-06-09 10:55:00 +05:30
utimes.c
Revert "ANDROID: vfs: Add setattr2 for filesystems with per mount permissions"
2020-05-29 14:48:38 +02:00
xattr.c
This is the 5.4.58 stable release
2020-08-11 18:37:58 +02:00