syzbot


KASAN: use-after-free Read in perf_trace_lock_acquire (2)

Status: fixed on 2018/04/24 21:47
Reported-by: syzbot+20eb18b1ffc36152b5608d41ab3bf6bd18c23aa7@syzkaller.appspotmail.com
Fix commit: 4cd879515d68 vhost_net: stop device during reset owner
First crash: 1729d, last: 1650d
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 922 1734d 1744d 0/23 closed as dup on 2017/10/31 13:14

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in perf_trace_lock_acquire+0x5b7/0x980 include/trace/events/lock.h:13
Read of size 8 at addr ffff8801cbe1c938 by task syzkaller813854/29705

CPU: 0 PID: 29705 Comm: syzkaller813854 Not tainted 4.15.0+ #286
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+0x5b7/0x980 include/trace/events/lock.h:13
 trace_lock_acquire include/trace/events/lock.h:13 [inline]
 lock_acquire+0x394/0x580 kernel/locking/lockdep.c:3914
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
 remove_wait_queue+0x81/0x350 kernel/sched/wait.c:50
 vhost_poll_stop drivers/vhost/vhost.c:230 [inline]
 vhost_dev_stop+0x15c/0x2a0 drivers/vhost/vhost.c:566
 vhost_net_release+0x6e/0x190 drivers/vhost/net.c:998
 __fput+0x327/0x7e0 fs/file_table.c:210
 ____fput+0x15/0x20 fs/file_table.c:244
 task_work_run+0x199/0x270 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x9bb/0x1ad0 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73f/0x16c0 kernel/signal.c:2335
 do_signal+0x90/0x1eb0 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:195 [inline]
 syscall_return_slowpath+0x490/0x550 arch/x86/entry/common.c:264
 entry_SYSCALL_64_fastpath+0x9e/0xa0
RIP: 0033:0x446279
RSP: 002b:00007fc33c053da8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00000000006dec2c RCX: 0000000000446279
RDX: 0000000000446279 RSI: 0000000000000001 RDI: 00000000006dec2c
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 00007fc33c054700 R11: 0000000000000246 R12: 00000000006dec28
R13: 6f68762f7665642f R14: 00007fc33c0549c0 R15: 0000000000000007

Allocated by task 29675:
 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:3610
 kmalloc include/linux/slab.h:499 [inline]
 eventfd_file_create.part.3+0x96/0x250 fs/eventfd.c:441
 eventfd_file_create fs/eventfd.c:483 [inline]
 SYSC_eventfd2 fs/eventfd.c:468 [inline]
 SyS_eventfd2 fs/eventfd.c:458 [inline]
 SYSC_eventfd fs/eventfd.c:485 [inline]
 SyS_eventfd+0x2c/0x80 fs/eventfd.c:483
 entry_SYSCALL_64_fastpath+0x29/0xa0

Freed by task 29705:
 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:3488 [inline]
 kfree+0xd6/0x260 mm/slab.c:3803
 eventfd_free_ctx fs/eventfd.c:72 [inline]
 eventfd_free fs/eventfd.c:79 [inline]
 kref_put include/linux/kref.h:70 [inline]
 eventfd_ctx_put+0x26/0x30 fs/eventfd.c:104
 eventfd_release+0x52/0x60 fs/eventfd.c:113
 __fput+0x327/0x7e0 fs/file_table.c:210
 ____fput+0x15/0x20 fs/file_table.c:244
 task_work_run+0x199/0x270 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x9bb/0x1ad0 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73f/0x16c0 kernel/signal.c:2335
 do_signal+0x90/0x1eb0 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:195 [inline]
 syscall_return_slowpath+0x490/0x550 arch/x86/entry/common.c:264
 entry_SYSCALL_64_fastpath+0x9e/0xa0

The buggy address belongs to the object at ffff8801cbe1c900
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 56 bytes inside of
 96-byte region [ffff8801cbe1c900, ffff8801cbe1c960)
The buggy address belongs to the page:
page:ffffea00072f8700 count:1 mapcount:0 mapping:ffff8801cbe1c000 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801cbe1c000 0000000000000000 0000000100000020
raw: ffffea00071a41e0 ffffea0007443260 ffff8801db0004c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801cbe1c800: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
 ffff8801cbe1c880: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
>ffff8801cbe1c900: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                                        ^
 ffff8801cbe1c980: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff8801cbe1ca00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (188):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce 2018/01/30 18:24 upstream 6304672b7f0a a899be78 .config log report syz C
ci-upstream-kasan-gce 2018/01/30 09:51 upstream 6304672b7f0a 08d47756 .config log report syz C
ci-upstream-kasan-gce-386 2018/02/01 01:02 upstream 3da90b159b14 02553e22 .config log report syz C
ci-upstream-kasan-gce-386 2018/01/30 16:54 upstream 6304672b7f0a a899be78 .config log report syz C
ci-upstream-kasan-gce 2018/02/02 01:57 upstream 7109a04eae81 67bd3383 .config log report
ci-upstream-kasan-gce 2018/02/01 10:25 upstream 255442c93843 02553e22 .config log report
ci-upstream-kasan-gce 2018/01/31 05:47 upstream 72906f38934a 02553e22 .config log report
ci-upstream-kasan-gce 2018/01/31 01:43 upstream 72906f38934a 02553e22 .config log report
ci-upstream-kasan-gce 2018/01/30 18:07 upstream 6304672b7f0a a899be78 .config log report
ci-upstream-kasan-gce 2018/01/30 14:51 upstream 6304672b7f0a a899be78 .config log report
ci-upstream-kasan-gce 2018/01/30 10:48 upstream 6304672b7f0a 08d47756 .config log report
ci-upstream-kasan-gce 2018/01/30 08:55 upstream 6304672b7f0a 08d47756 .config log report
ci-upstream-kasan-gce 2018/01/30 08:24 upstream 6304672b7f0a 08d47756 .config log report
ci-upstream-kasan-gce 2018/01/29 09:43 upstream 24b1cccf9229 08d47756 .config log report
ci-upstream-kasan-gce 2018/01/27 21:23 upstream c4e0ca7fa241 08146b1a .config log report
ci-upstream-kasan-gce 2018/01/27 15:41 upstream c4e0ca7fa241 1d18b112 .config log report
ci-upstream-kasan-gce 2018/01/27 04:05 upstream c4e0ca7fa241 1d18b112 .config log report
ci-upstream-kasan-gce 2018/01/26 12:19 upstream 993ca2068b04 1d18b112 .config log report
ci-upstream-kasan-gce 2018/01/22 23:26 upstream 0d665e7b109d 228e3d95 .config log report
ci-upstream-kasan-gce 2018/01/22 11:12 upstream 5515114211c5 fbbdcd92 .config log report
ci-upstream-kasan-gce 2018/01/17 23:23 upstream 88dc7fca1800 b8970f31 .config log report
ci-upstream-kasan-gce 2018/01/16 21:50 upstream 41aa5e5d712b a46e5318 .config log report
ci-upstream-kasan-gce 2018/01/16 21:48 upstream 41aa5e5d712b a46e5318 .config log report
ci-upstream-kasan-gce 2018/01/16 03:22 upstream a8750ddca918 e17f4a5d .config log report
ci-upstream-kasan-gce 2018/01/15 01:50 upstream 9443c168505d 66d492a6 .config log report
ci-upstream-kasan-gce 2018/01/13 18:41 upstream c92a9a461dff c9e7aeae .config log report
ci-upstream-kasan-gce 2018/01/12 13:07 upstream 1545dec46db3 9dc808a6 .config log report
ci-upstream-kasan-gce 2018/01/11 11:11 upstream 5f615b97cdea 9dc808a6 .config log report
ci-upstream-kasan-gce 2018/01/11 09:36 upstream 5f615b97cdea 02a19b64 .config log report
ci-upstream-kasan-gce 2018/01/11 09:34 upstream 5f615b97cdea 02a19b64 .config log report
ci-upstream-kasan-gce 2018/01/10 22:46 upstream 5f615b97cdea 02a19b64 .config log report
ci-upstream-kasan-gce 2018/01/09 22:40 upstream d476c5334f1d 1f60c828 .config log report
ci-upstream-kasan-gce 2018/01/09 11:56 upstream d32da5841b0f 11dc42f6 .config log report
ci-upstream-kasan-gce 2018/01/07 10:18 upstream 3219e264b984 19c05fff .config log report
ci-upstream-kasan-gce 2018/01/07 07:02 upstream 3219e264b984 19c05fff .config log report
ci-upstream-kasan-gce 2018/01/06 20:41 upstream 3219e264b984 053171ea .config log report
ci-upstream-kasan-gce 2018/01/05 17:54 upstream e1915c8195b3 00193447 .config log report
ci-upstream-kasan-gce 2018/01/05 06:38 upstream e1915c8195b3 00193447 .config log report
ci-upstream-kasan-gce 2018/01/04 20:30 upstream 00a5ae218d57 00193447 .config log report
ci-upstream-kasan-gce 2018/01/03 20:51 upstream d6bbd51587ec 00193447 .config log report
ci-upstream-kasan-gce 2018/01/03 19:02 upstream 30a7acd57389 00193447 .config log report
ci-upstream-kasan-gce 2018/01/03 15:01 upstream 30a7acd57389 00193447 .config log report
ci-upstream-kasan-gce-386 2018/02/01 12:33 upstream 255442c93843 02553e22 .config log report
ci-upstream-kasan-gce-386 2018/02/01 00:20 upstream 3da90b159b14 02553e22 .config log report