syzbot


KASAN: stack-out-of-bounds Read in rb_next (2)

Status: fixed on 2018/08/07 13:43
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+deb76debb3a97f8f454c@syzkaller.appspotmail.com
Fix commit: 99ba2b5aba24 bpf: sockhash, disallow bpf_tcp_close and update in parallel
First crash: 2163d, last: 2163d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: stack-out-of-bounds Read in rb_next kernel 1 2175d 2175d 0/27 closed as invalid on 2018/07/07 11:48

Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in rb_next+0x10f/0x140 lib/rbtree.c:553
Read of size 8 at addr ffff880199837ce8 by task syz-executor1/8186

CPU: 0 PID: 8186 Comm: syz-executor1 Not tainted 4.18.0-rc3+ #58
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 rb_next+0x10f/0x140 lib/rbtree.c:553
 timerqueue_del+0xd8/0x150 lib/timerqueue.c:83
 __remove_hrtimer+0xa8/0x1b0 kernel/time/hrtimer.c:984
 __run_hrtimer kernel/time/hrtimer.c:1380 [inline]
 __hrtimer_run_queues+0x369/0x10c0 kernel/time/hrtimer.c:1460
 hrtimer_interrupt+0x2f3/0x750 kernel/time/hrtimer.c:1518
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1025 [inline]
 smp_apic_timer_interrupt+0x165/0x730 arch/x86/kernel/apic/apic.c:1050
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:863
 </IRQ>
RIP: 0010:__read_once_size include/linux/compiler.h:188 [inline]
RIP: 0010:check_kcov_mode kernel/kcov.c:69 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x26/0x50 kernel/kcov.c:101
Code: 5d c3 66 90 55 65 48 8b 04 25 40 ee 01 00 65 8b 15 ef e1 85 7e 48 89 e5 81 e2 00 01 1f 00 48 8b 75 08 75 2b 8b 90 90 12 00 00 <83> fa 02 75 20 48 8b 88 98 12 00 00 8b 80 94 12 00 00 48 8b 11 48 
RSP: 0018:ffff88019a157258 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: ffff8801ce7ca500 RBX: ffff8801a6e226b0 RCX: ffffc9000b25e000
RDX: 0000000000000002 RSI: ffffffff81d1c55c RDI: 0000000000000005
RBP: ffff88019a157258 R08: ffff8801ce7ca500 R09: fffff94000e40696
R10: fffff94000e40696 R11: ffffea00072034b7 R12: 0000000000000007
R13: 0000000000000000 R14: 1ffff1003342ae51 R15: ffff88019a1575b0
 __mark_inode_dirty+0x7bc/0x1550 fs/fs-writeback.c:2128
 mark_inode_dirty include/linux/fs.h:2046 [inline]
 generic_write_end+0x3a1/0x4f0 fs/buffer.c:2149
 ext4_da_write_end+0x2c7/0xc70 fs/ext4/inode.c:3175
 generic_perform_write+0x4e0/0x6c0 mm/filemap.c:3150
 __generic_file_write_iter+0x26e/0x630 mm/filemap.c:3264
 ext4_file_write_iter+0x390/0x1430 fs/ext4/file.c:266
 call_write_iter include/linux/fs.h:1793 [inline]
 new_sync_write fs/read_write.c:474 [inline]
 __vfs_write+0x6c6/0x9f0 fs/read_write.c:487
 vfs_write+0x1f8/0x560 fs/read_write.c:549
 ksys_write+0x101/0x260 fs/read_write.c:598
 __do_sys_write fs/read_write.c:610 [inline]
 __se_sys_write fs/read_write.c:607 [inline]
 __x64_sys_write+0x73/0xb0 fs/read_write.c:607
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x455ab9
Code: 1d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 eb b9 fb ff c3 66 2e 0f 1f 84 00 00 00 00 
RSP: 002b:00007f7eea029c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f7eea02a6d4 RCX: 0000000000455ab9
RDX: 00000000ffffff7a RSI: 0000000020000080 RDI: 0000000000000013
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000004c2cae R14: 00000000004d4cc8 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea0006660dc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 ffffea0006660dc8 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff880199837b80: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2
 ffff880199837c00: f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2 f2 00 f2
>ffff880199837c80: f2 f2 f2 f2 f2 f2 f8 f2 f2 f2 f2 f2 f2 f2 00 f2
                                                          ^
 ffff880199837d00: f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff880199837d80: 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 f2
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/07/18 22:20 bpf-next 8ae71e76cf1f 809256c3 .config console log report ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.