syzbot


KASAN: use-after-free Write in get_block

Status: auto-closed as invalid on 2020/09/02 00:35
Reported-by: syzbot+1fde2a0dfc903e8c5d2e@syzkaller.appspotmail.com
First crash: 1471d, last: 1452d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Write in get_block C inconclusive 5 1426d 1474d 0/1 upstream: reported C repro on 2020/04/12 23:36
upstream KASAN: use-after-free Write in get_block fs C inconclusive inconclusive 12 1399d 1449d 15/26 fixed on 2020/09/16 22:51

Sample crash report:
EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue
==================================================================
BUG: KASAN: use-after-free in alloc_branch fs/minix/itree_common.c:92 [inline]
BUG: KASAN: use-after-free in get_block+0x11e1/0x1300 fs/minix/itree_common.c:191
Write of size 2 at addr ffff88821293b7b8 by task syz-executor.1/6587

CPU: 0 PID: 6587 Comm: syz-executor.1 Not tainted 4.19.120-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 print_address_description.cold+0x7c/0x212 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report mm/kasan/report.c:412 [inline]
 kasan_report.cold+0x88/0x2b9 mm/kasan/report.c:396
 alloc_branch fs/minix/itree_common.c:92 [inline]
 get_block+0x11e1/0x1300 fs/minix/itree_common.c:191
 minix_get_block+0xe5/0x110 fs/minix/inode.c:379
 __block_write_begin_int+0x480/0x17a0 fs/buffer.c:1978
 __block_write_begin fs/buffer.c:2028 [inline]
 block_write_begin+0x58/0x2e0 fs/buffer.c:2087
 minix_write_begin+0x35/0xe0 fs/minix/inode.c:415
 generic_perform_write+0x1f8/0x4d0 mm/filemap.c:3162
 __generic_file_write_iter+0x24c/0x610 mm/filemap.c:3287
 generic_file_write_iter+0x37f/0x729 mm/filemap.c:3315
 call_write_iter include/linux/fs.h:1821 [inline]
 new_sync_write fs/read_write.c:474 [inline]
 __vfs_write+0x512/0x760 fs/read_write.c:487
 __kernel_write+0x109/0x370 fs/read_write.c:506
 do_acct_process+0xcd8/0x10e0 kernel/acct.c:520
 acct_pin_kill+0x29/0xf0 kernel/acct.c:174
 pin_kill+0x17a/0x7e0 fs/fs_pin.c:50
 mnt_pin_kill+0x6c/0x1c0 fs/fs_pin.c:87
 cleanup_mnt+0x116/0x150 fs/namespace.c:1095
 task_work_run+0x13f/0x1b0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:193 [inline]
 exit_to_usermode_loop+0x25a/0x2b0 arch/x86/entry/common.c:167
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45f257
Code: 64 89 04 25 d0 02 00 00 58 5f ff d0 48 89 c7 e8 8f be ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 ad 8c fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd3d5bb578 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000045f257
RDX: 0000000000402ff8 RSI: 0000000000000002 RDI: 00007ffd3d5bb620
RBP: 0000000000000f65 R08: 0000000000000000 R09: 000000000000000c
R10: 0000000000000005 R11: 0000000000000246 R12: 00007ffd3d5bc6b0
R13: 0000000001779940 R14: 0000000000000000 R15: 00007ffd3d5bc6b0

The buggy address belongs to the page:
page:ffffea00084a4ec0 count:0 mapcount:0 mapping:0000000000000000 index:0x1
flags: 0x57ffe0000000000()
raw: 057ffe0000000000 ffffea00084cf348 ffffea00084a4fc8 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88821293b680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88821293b700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88821293b780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                        ^
 ffff88821293b800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88821293b880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/05/05 00:35 linux-4.19.y fdc072324f3c 9941337c .config console log report ci2-linux-4-19
2020/05/02 22:05 linux-4.19.y fdc072324f3c 58da4c35 .config console log report ci2-linux-4-19
2020/04/15 21:14 linux-4.19.y 6dd0e32665e5 3f3c5574 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.