syzbot


KASAN: use-after-free Read in perf_trace_lock_acquire

Status: closed as dup on 2017/10/31 13:14
Reported-by: syzbot+eec541c6a1e7663177fcb48a5814c0a0776c9f68@syzkaller.appspotmail.com
First crash: 1739d, last: 1695d
Duplicate of (1):
Title Repro Cause bisect Fix bisect Count Last Reported
WARNING in get_pi_state C 42 1703d 1705d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in perf_trace_lock_acquire (2) C 188 1611d 1683d 6/22 fixed on 2018/04/24 21:47

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in perf_trace_lock_acquire+0x8cf/0x900 include/trace/events/lock.h:13
Read of size 8 at addr ffff8801cc333400 by task syz-executor5/5270

CPU: 1 PID: 5270 Comm: syz-executor5 Not tainted 4.14.0-rc7+ #72
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:53
 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_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 perf_trace_lock_acquire+0x8cf/0x900 include/trace/events/lock.h:13
 trace_lock_acquire include/trace/events/lock.h:13 [inline]
 lock_acquire+0x394/0x580 kernel/locking/lockdep.c:3993
 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline]
 _raw_spin_lock_irq+0x5e/0x80 kernel/locking/spinlock.c:168
 exit_pi_state_list+0x369/0x7a0 kernel/futex.c:914
 mm_release+0x46d/0x590 kernel/fork.c:1148
 exit_mm kernel/exit.c:499 [inline]
 do_exit+0x481/0x1ad0 kernel/exit.c:852
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73f/0x16d0 kernel/signal.c:2334
 do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:809
 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 arch/x86/entry/common.c:266 [inline]
 do_syscall_32_irqs_on arch/x86/entry/common.c:335 [inline]
 do_fast_syscall_32+0x83e/0xf05 arch/x86/entry/common.c:391
 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:125
RIP: 0023:0xf7f80c79
RSP: 002b:00000000f775b01c EFLAGS: 00000296 ORIG_RAX: 0000000000000135
RAX: fffffffffffffdfe RBX: 0000000020c1a000 RCX: 0000000000000005
RDX: 000000002021c000 RSI: 000000002091fff8 RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 5296:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 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:494 [inline]
 kzalloc include/linux/slab.h:667 [inline]
 refill_pi_state_cache.part.6+0xa5/0x2f0 kernel/futex.c:790
 refill_pi_state_cache kernel/futex.c:1818 [inline]
 futex_requeue+0x1887/0x2370 kernel/futex.c:1885
 do_futex+0x8d0/0x2280 kernel/futex.c:3496
 C_SYSC_futex kernel/futex_compat.c:201 [inline]
 compat_SyS_futex+0x27f/0x380 kernel/futex_compat.c:175
 do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline]
 do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391
 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:125

Freed by task 5277:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 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
 unqueue_me_pi+0x4a/0xc0 kernel/futex.c:2274
 futex_wait_requeue_pi.constprop.19+0xc7f/0x1300 kernel/futex.c:3193
 do_futex+0x900/0x2280 kernel/futex.c:3493
 C_SYSC_futex kernel/futex_compat.c:201 [inline]
 compat_SyS_futex+0x27f/0x380 kernel/futex_compat.c:175
 do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline]
 do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391
 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:125

The buggy address belongs to the object at ffff8801cc3333c0
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 64 bytes inside of
 256-byte region [ffff8801cc3333c0, ffff8801cc3334c0)
The buggy address belongs to the page:
page:ffffea000730ccc0 count:1 mapcount:0 mapping:ffff8801cc333000 index:0xffff8801cc333a00
flags: 0x200000000000100(slab)
raw: 0200000000000100 ffff8801cc333000 ffff8801cc333a00 0000000100000007
raw: ffffea00072ebe60 ffffea000730b3e0 ffff8801dac007c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801cc333300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801cc333380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff8801cc333400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8801cc333480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8801cc333500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (922):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce 2017/11/05 02:20 upstream 2d6349944d96 ff12ae31 .config log report
ci-upstream-kasan-gce 2017/11/04 18:13 upstream d4c2e9fca5b7 c78b455b .config log report
ci-upstream-kasan-gce 2017/11/03 22:13 upstream 866ba84ea30f e930d6f6 .config log report
ci-upstream-kasan-gce 2017/10/22 17:13 upstream b5ac3beb5a9f ab829b1b .config log report
ci-upstream-kasan-gce 2017/10/02 04:49 upstream 368f89984bb9 c26ea367 .config log report
ci-upstream-kasan-gce-386 2017/10/31 14:39 upstream 5f479447d983 2de9b525 .config log report
ci-upstream-kasan-gce-386 2017/10/24 11:28 upstream 6cff0a118f23 92f543f0 .config log report
ci-upstream-kasan-gce-386 2017/10/08 13:52 upstream 85b1bb248071 c26ea367 .config log report
ci-upstream-kasan-gce-386 2017/10/07 19:02 upstream 1c86f2e4c84f c26ea367 .config log report
ci-upstream-kasan-gce-386 2017/10/07 08:05 upstream dbeb1a8ff547 c26ea367 .config log report
ci-upstream-kasan-gce-386 2017/10/04 01:24 upstream 887c8ba753fb c26ea367 .config log report
ci-upstream-mmots-kasan-gce 2017/11/09 04:02 mmots 0f611fb6dcc0 e0a2b195 .config log report
ci-upstream-mmots-kasan-gce 2017/11/02 17:36 mmots 0f611fb6dcc0 e0a2b195 .config log report
ci-upstream-mmots-kasan-gce 2017/11/02 05:19 mmots 0f611fb6dcc0 e0a2b195 .config log report
ci-upstream-next-kasan-gce 2017/10/28 03:03 linux-next 36ef71cae353 e511d9f8 .config log report
ci-upstream-next-kasan-gce 2017/10/13 10:07 linux-next 49827b977a2e 441d64d9 .config log report
ci-upstream-next-kasan-gce 2017/10/09 21:28 linux-next 1418b852174a c26ea367 .config log report
ci-upstream-mmots-kasan-gce 2017/10/02 15:15 mmots c0232cb3af70 c26ea367 .config log report
ci-upstream-next-kasan-gce 2017/10/02 07:47 linux-next 1418b852174a c26ea367 .config log report
ci-upstream-next-kasan-gce 2017/09/27 16:30 linux-next 045c5205823f c26ea367 .config log report