syzbot


KASAN: use-after-free Read in lock_release

Status: closed as invalid on 2017/12/06 12:45
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+14fe2e30eb4894d336e0ddb94e54a49c7c877a5a@syzkaller.appspotmail.com
First crash: 2883d, last: 2883d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in cross_lock kernel/locking/lockdep.c:4796 [inline]
BUG: KASAN: use-after-free in lock_release_crosslock kernel/locking/lockdep.c:5111 [inline]
BUG: KASAN: use-after-free in __lock_release kernel/locking/lockdep.c:3751 [inline]
BUG: KASAN: use-after-free in lock_release+0xd5b/0xd70 kernel/locking/lockdep.c:4021
Read of size 4 at addr ffff8801c97d0188 by task syz-executor5/6191

CPU: 0 PID: 6191 Comm: syz-executor5 Not tainted 4.14.0-rc4-next-20171009+ #33
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:52
 print_address_description+0x73/0x250 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report+0x25b/0x340 mm/kasan/report.c:409
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429
 cross_lock kernel/locking/lockdep.c:4796 [inline]
 lock_release_crosslock kernel/locking/lockdep.c:5111 [inline]
 __lock_release kernel/locking/lockdep.c:3751 [inline]
 lock_release+0xd5b/0xd70 kernel/locking/lockdep.c:4021
 __raw_spin_unlock include/linux/spinlock_api_smp.h:150 [inline]
 _raw_spin_unlock+0x1a/0x30 kernel/locking/spinlock.c:183
 exit_pi_state_list+0x598/0x7a0 kernel/futex.c:921
 mm_release+0x46d/0x590 kernel/fork.c:1190
 exit_mm kernel/exit.c:499 [inline]
 do_exit+0x481/0x1b00 kernel/exit.c:856
 do_group_exit+0x149/0x400 kernel/exit.c:972
 get_signal+0x73f/0x16d0 kernel/signal.c:2334
 do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:808
 exit_to_usermode_loop+0x214/0x310 arch/x86/entry/common.c:158
 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
 syscall_return_slowpath+0x42f/0x510 arch/x86/entry/common.c:266
 entry_SYSCALL_64_fastpath+0xbc/0xbe
RIP: 0033:0x4520a9
RSP: 002b:00007ff660fefc08 EFLAGS: 00000216 ORIG_RAX: 00000000000000ca
RAX: 0000000000000000 RBX: 0000000000718210 RCX: 00000000004520a9
RDX: 0000000000000004 RSI: 000080000000000b RDI: 000000002000cffc
RBP: 00000000000008f0 R08: 0000000020048000 R09: 0000000000000000
R10: 000000002000b000 R11: 0000000000000216 R12: 00000000004b77c8
R13: 00000000ffffffff R14: 000000002000cffc R15: 000080000000000b

Allocated by task 6194:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3628
 kmalloc include/linux/slab.h:508 [inline]
 kzalloc include/linux/slab.h:697 [inline]
 refill_pi_state_cache.part.6+0xa5/0x2f0 kernel/futex.c:790
 refill_pi_state_cache kernel/futex.c:1810 [inline]
 futex_requeue+0x1887/0x2370 kernel/futex.c:1877
 do_futex+0x7f5/0x20d0 kernel/futex.c:3488
 SYSC_futex kernel/futex.c:3526 [inline]
 SyS_futex+0x260/0x390 kernel/futex.c:3494
 entry_SYSCALL_64_fastpath+0x1f/0xbe

Freed by task 6175:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3504 [inline]
 kfree+0xca/0x250 mm/slab.c:3821
 put_pi_state+0x3f4/0x560 kernel/futex.c:852
 exit_pi_state_list+0x57a/0x7a0 kernel/futex.c:937
 mm_release+0x46d/0x590 kernel/fork.c:1190
 exit_mm kernel/exit.c:499 [inline]
 do_exit+0x481/0x1b00 kernel/exit.c:856
 do_group_exit+0x149/0x400 kernel/exit.c:972
 get_signal+0x73f/0x16d0 kernel/signal.c:2334
 do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:808
 exit_to_usermode_loop+0x214/0x310 arch/x86/entry/common.c:158
 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
 syscall_return_slowpath+0x42f/0x510 arch/x86/entry/common.c:266
 entry_SYSCALL_64_fastpath+0xbc/0xbe

The buggy address belongs to the object at ffff8801c97d0140
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 72 bytes inside of
 256-byte region [ffff8801c97d0140, ffff8801c97d0240)
The buggy address belongs to the page:
page:ffffea000725f400 count:1 mapcount:0 mapping:ffff8801c97d0000 index:0x0
flags: 0x200000000000100(slab)
raw: 0200000000000100 ffff8801c97d0000 0000000000000000 000000010000000c
raw: ffffea000725f320 ffffea000725f520 ffff8801dac007c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c97d0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801c97d0100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff8801c97d0180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff8801c97d0200: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8801c97d0280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/10/10 05:26 linux-next 49827b977a2e 441d64d9 .config console log report ci-upstream-next-kasan-gce
* Struck through repros no longer work on HEAD.