audit: type=1326 audit(1550538545.205:392): auid=4294967295 uid=0 gid=0 ses=4294967295 subj==unconfined pid=27225 comm="syz-executor.2" exe="/root/syz-executor.2" sig=31 arch=c000003e syscall=228 compat=0 ip=0x45ac8a code=0x0 ================================================================== BUG: KASAN: use-after-free in perf_trace_lock_acquire+0x420/0x580 include/trace/events/lock.h:13 Read of size 8 at addr ffff8880a06ebf98 by task syz-executor.2/27227 CPU: 1 PID: 27227 Comm: syz-executor.2 Not tainted 5.0.0-rc7 #77 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 perf_trace_lock_acquire+0x420/0x580 include/trace/events/lock.h:13 trace_lock_acquire include/trace/events/lock.h:13 [inline] lock_acquire+0x29c/0x3f0 kernel/locking/lockdep.c:3840 __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0xf7/0x1310 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 seccomp_notify_release+0x62/0x280 kernel/seccomp.c:982 __fput+0x2df/0x8d0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x92c/0x2fd0 kernel/exit.c:875 do_group_exit+0x135/0x370 kernel/exit.c:979 get_signal+0x399/0x1d50 kernel/signal.c:2575 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:816 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457e29 Code: 24 28 48 89 4c 24 08 66 c7 44 24 10 01 01 48 c7 44 24 18 00 00 00 00 e8 a5 b0 fc ff 48 8b 44 24 38 48 89 04 24 e8 d7 77 fb ff <48> 8b 6c 24 40 48 83 c4 48 c3 48 89 d1 eb 90 e8 73 20 00 00 e9 7e RSP: 002b:00007f77613cacf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000073bf08 RCX: 0000000000457e29 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000073bf08 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000073bf0c R13: 0000000000a4fb7f R14: 00007f77613cb9c0 R15: 000000000073bf0c Allocated by task 27227: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3609 kmalloc include/linux/slab.h:545 [inline] kzalloc include/linux/slab.h:740 [inline] seccomp_prepare_filter kernel/seccomp.c:451 [inline] seccomp_prepare_user_filter kernel/seccomp.c:491 [inline] seccomp_set_mode_filter kernel/seccomp.c:1260 [inline] do_seccomp+0x73e/0x2250 kernel/seccomp.c:1374 __do_sys_seccomp kernel/seccomp.c:1393 [inline] __se_sys_seccomp kernel/seccomp.c:1390 [inline] __x64_sys_seccomp+0x73/0xb0 kernel/seccomp.c:1390 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 27227: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:458 kasan_slab_free+0xe/0x10 mm/kasan/common.c:466 __cache_free mm/slab.c:3487 [inline] kfree+0xcf/0x230 mm/slab.c:3806 seccomp_filter_free kernel/seccomp.c:565 [inline] seccomp_filter_free kernel/seccomp.c:561 [inline] seccomp_set_mode_filter kernel/seccomp.c:1315 [inline] do_seccomp+0xafb/0x2250 kernel/seccomp.c:1374 __do_sys_seccomp kernel/seccomp.c:1393 [inline] __se_sys_seccomp kernel/seccomp.c:1390 [inline] __x64_sys_seccomp+0x73/0xb0 kernel/seccomp.c:1390 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a06ebf00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 152 bytes inside of 192-byte region [ffff8880a06ebf00, ffff8880a06ebfc0) The buggy address belongs to the page: page:ffffea000281bac0 count:1 mapcount:0 mapping:ffff88812c3f0040 index:0xffff8880a06eb400 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00027cfbc8 ffffea000266b1c8 ffff88812c3f0040 raw: ffff8880a06eb400 ffff8880a06eb000 000000010000000f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a06ebe80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a06ebf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a06ebf80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880a06ec000: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fb fb ffff8880a06ec080: fb fb fb fb fb fb fb fb fc fc fc fc fb fb fb fb ==================================================================