sysv_free_block: flc_count > flc_size
sysv_free_block: flc_count > flc_size
sysv_free_block: flc_count > flc_size
sysv_free_block: flc_count > flc_size
==================================================================
BUG: KASAN: use-after-free in sysv_new_block+0x79f/0x990 fs/sysv/balloc.c:113
Read of size 4 at addr ffff88808c01d0c8 by task syz-executor420/8100
CPU: 1 PID: 8100 Comm: syz-executor420 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load4_noabort+0x88/0x90 mm/kasan/report.c:432
sysv_new_block+0x79f/0x990 fs/sysv/balloc.c:113
alloc_branch fs/sysv/itree.c:134 [inline]
get_block+0x3fa/0x1510 fs/sysv/itree.c:251
__block_write_begin_int+0x46c/0x17b0 fs/buffer.c:1978
__block_write_begin fs/buffer.c:2028 [inline]
block_write_begin+0x58/0x2e0 fs/buffer.c:2087
sysv_write_begin+0x35/0xe0 fs/sysv/itree.c:485
generic_perform_write+0x1f8/0x4d0 mm/filemap.c:3170
__generic_file_write_iter+0x24b/0x610 mm/filemap.c:3295
generic_file_write_iter+0x3f8/0x730 mm/filemap.c:3323
call_write_iter include/linux/fs.h:1821 [inline]
new_sync_write fs/read_write.c:474 [inline]
__vfs_write+0x51b/0x770 fs/read_write.c:487
vfs_write+0x1f3/0x540 fs/read_write.c:549
ksys_write+0x12b/0x2a0 fs/read_write.c:599
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f605e78c6a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd68472268 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffd684722a8 RCX: 00007f605e78c6a9
RDX: 00000000fffffd5e RSI: 000000002000ad00 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd684722a0
R13: 0000000000000000 R14: 431bde82d7b634db R15: 0000000000000000
The buggy address belongs to the page:
page:ffffea0002300740 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0xfff00000000000()
raw: 00fff00000000000 0000000000000000 ffffea0002300748 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88808c01cf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808c01d000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88808c01d080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88808c01d100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808c01d180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================