android_kernel_samsung_a7y1.../fs/f2fs
Chao Yu a8dc9be10c f2fs: fix to do sanity check on segment bitmap of LFS curseg
[ Upstream commit c854f4d681365498f53ba07843a16423625aa7e9 ]

As Jungyeon Reported in bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=203233

- Reproduces
gcc poc_13.c
./run.sh f2fs

- Kernel messages
 F2FS-fs (sdb): Bitmap was wrongly set, blk:4608
 kernel BUG at fs/f2fs/segment.c:2133!
 RIP: 0010:update_sit_entry+0x35d/0x3e0
 Call Trace:
  f2fs_allocate_data_block+0x16c/0x5a0
  do_write_page+0x57/0x100
  f2fs_do_write_node_page+0x33/0xa0
  __write_node_page+0x270/0x4e0
  f2fs_sync_node_pages+0x5df/0x670
  f2fs_write_checkpoint+0x364/0x13a0
  f2fs_sync_fs+0xa3/0x130
  f2fs_do_sync_file+0x1a6/0x810
  do_fsync+0x33/0x60
  __x64_sys_fsync+0xb/0x10
  do_syscall_64+0x43/0x110
  entry_SYSCALL_64_after_hwframe+0x44/0xa9

The testcase fails because that, in fuzzed image, current segment was
allocated with LFS type, its .next_blkoff should point to an unused
block address, but actually, its bitmap shows it's not. So during
allocation, f2fs crash when setting bitmap.

Introducing sanity_check_curseg() to check such inconsistence of
current in-used segment.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 07:36:58 +02:00
..
acl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
acl.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
checkpoint.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto_policy.c fscrypt: don't set policy for a dead directory 2020-04-06 19:29:02 +02:00
data.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dir.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extent_cache.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
f2fs.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
file.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gc.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hash.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inline.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
namei.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
node.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
node.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
recovery.c f2fs: fix to avoid panic in do_recover_data() 2020-04-06 19:01:55 +02:00
segment.c f2fs: fix to do sanity check on segment bitmap of LFS curseg 2020-04-07 07:36:58 +02:00
segment.h f2fs: fix to do sanity check on valid block count of segment 2020-04-06 19:01:57 +02:00
shrinker.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
super.c f2fs: check all the data segments against all node ones 2020-04-07 07:36:53 +02:00
sysfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
trace.c f2fs: do not use mutex lock in atomic context 2020-04-06 14:24:14 +02:00
trace.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30