bisecting fixing commit since cbfa1702aaf69b2311ea1b35e04f113c48368c67 building syzkaller on fc7735a27949755327024847e12dcc1b868bcb99 testing commit cbfa1702aaf69b2311ea1b35e04f113c48368c67 with gcc (GCC) 8.4.1 20210217 kernel signature: a426247a0173443822690e8d682bcf3d1c875dba14c54547d5cd23893dc7cde2 run #0: crashed: KASAN: slab-out-of-bounds Read in perf_output_read run #1: crashed: KASAN: use-after-free Read in perf_output_read run #2: crashed: KASAN: use-after-free Read in perf_output_read run #3: crashed: KASAN: use-after-free Read in perf_output_read run #4: crashed: KASAN: use-after-free Read in perf_output_read run #5: crashed: KASAN: use-after-free Read in perf_output_read run #6: crashed: KASAN: use-after-free Read in perf_output_read run #7: crashed: KASAN: use-after-free Read in perf_output_read run #8: crashed: KASAN: use-after-free Read in perf_output_read run #9: crashed: KASAN: use-after-free Read in perf_output_read run #10: crashed: KASAN: use-after-free Read in perf_output_read run #11: crashed: KASAN: use-after-free Read in perf_output_read run #12: crashed: KASAN: slab-out-of-bounds Read in perf_output_read run #13: crashed: KASAN: slab-out-of-bounds Read in perf_output_read run #14: crashed: KASAN: use-after-free Read in perf_output_read run #15: crashed: KASAN: use-after-free Read in perf_output_read run #16: crashed: KASAN: use-after-free Read in perf_output_read run #17: crashed: KASAN: use-after-free Read in perf_output_read run #18: OK run #19: crashed: KASAN: use-after-free Read in perf_output_read testing current HEAD cf256fbcbe347b7d0ff58fe2dfa382a156bd3694 testing commit cf256fbcbe347b7d0ff58fe2dfa382a156bd3694 with gcc (GCC) 8.4.1 20210217 kernel signature: a907a084fab0f4575a7659dd73040519473e225edb2757bd69dde8cc7f6101b9 run #0: crashed: KASAN: use-after-free Read in perf_output_read run #1: crashed: KASAN: use-after-free Read in perf_output_read run #2: crashed: KASAN: use-after-free Read in perf_output_read run #3: crashed: KASAN: use-after-free Read in perf_output_read run #4: crashed: BUG: soft lockup in __perf_sw_event run #5: crashed: KASAN: use-after-free Read in perf_output_read run #6: crashed: BUG: soft lockup in __perf_sw_event run #7: crashed: KASAN: use-after-free Read in perf_output_read run #8: crashed: KASAN: use-after-free Read in perf_output_read run #9: crashed: KASAN: use-after-free Read in perf_output_read revisions tested: 2, total time: 37m52.719977915s (build: 15m11.241682914s, test: 22m19.384361166s) the crash still happens on HEAD commit msg: Linux 4.14.231 crash: KASAN: use-after-free Read in perf_output_read IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ================================================================== BUG: KASAN: use-after-free in perf_output_read_group kernel/events/core.c:5895 [inline] BUG: KASAN: use-after-free in perf_output_read+0x1181/0x14f0 kernel/events/core.c:5930 Read of size 8 at addr ffff8881d81a1d88 by task syz-executor737/27400 CPU: 0 PID: 27400 Comm: syz-executor737 Not tainted 4.14.231-syzkaller #0 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+0x14b/0x1e7 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold.7+0x11a/0x2d3 mm/kasan/report.c:393 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 perf_output_read_group kernel/events/core.c:5895 [inline] perf_output_read+0x1181/0x14f0 kernel/events/core.c:5930 perf_output_sample+0x1276/0x1910 kernel/events/core.c:5972 __perf_event_output kernel/events/core.c:6285 [inline] perf_event_output_forward+0x103/0x1d0 kernel/events/core.c:6298 __perf_event_overflow+0x107/0x300 kernel/events/core.c:7547 perf_swevent_overflow+0x165/0x210 kernel/events/core.c:7623 perf_swevent_event+0x1f5/0x2f0 kernel/events/core.c:7656 do_perf_sw_event kernel/events/core.c:7764 [inline] ___perf_sw_event+0x26b/0x3f0 kernel/events/core.c:7795 __perf_sw_event+0x3c/0x60 kernel/events/core.c:7807 perf_sw_event include/linux/perf_event.h:1046 [inline] __do_page_fault+0x648/0xb10 arch/x86/mm/fault.c:1483 do_page_fault+0x64/0x400 arch/x86/mm/fault.c:1517 page_fault+0x25/0x50 arch/x86/entry/entry_64.S:1123 RIP: 0010:copy_user_enhanced_fast_string+0xe/0x20 arch/x86/lib/copy_user_64.S:181 RSP: 0018:ffff8881d2647918 EFLAGS: 00010206 RAX: 0000000000000000 RBX: 0000000020eb5acb RCX: 0000000000006acb RDX: 0000000000008000 RSI: 0000000020eb7000 RDI: ffff8881e0539535 RBP: ffff8881d2647940 R08: 0000000000000000 R09: 0000000000000200 R10: ffffed103c0a7fff R11: ffff8881e053ffff R12: ffff8881e0538000 R13: ffff8881ed9ba100 R14: ffff8881d2647db0 R15: ffff8881d2647d60 _copy_from_iter_full+0x166/0x760 lib/iov_iter.c:608 copy_from_iter_full include/linux/uio.h:126 [inline] skb_do_copy_data_nocache include/net/sock.h:1889 [inline] skb_copy_to_page_nocache include/net/sock.h:1915 [inline] tcp_sendmsg_locked+0x193f/0x3a10 net/ipv4/tcp.c:1360 tcp_sendmsg+0x27/0x40 net/ipv4/tcp.c:1457 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:656 SYSC_sendto net/socket.c:1763 [inline] SyS_sendto+0x1e4/0x2c0 net/socket.c:1731 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x449179 RSP: 002b:00007fc949fd6308 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00000000004ce4e8 RCX: 0000000000449179 RDX: ffffffffffffffef RSI: 0000000020d7cfcb RDI: 0000000000000004 RBP: 00000000004ce4e0 R08: 0000000000000000 R09: 0000000000000053 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049d474 R13: 00007ffc3b3be23f R14: 00007fc949fd6400 R15: 0000000000022000 Allocated by task 5800: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15d/0x410 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] kzalloc include/linux/slab.h:661 [inline] __alloc_workqueue_key+0xf8/0xc80 kernel/workqueue.c:4003 ieee80211_register_hw+0x11ce/0x3510 net/mac80211/main.c:1078 mac80211_hwsim_new_radio+0x18ce/0x27e0 drivers/net/wireless/mac80211_hwsim.c:2705 hwsim_new_radio_nl+0x386/0x610 drivers/net/wireless/mac80211_hwsim.c:3164 genl_family_rcv_msg+0x57f/0xfe0 net/netlink/genetlink.c:600 genl_rcv_msg+0xa7/0x140 net/netlink/genetlink.c:625 netlink_rcv_skb+0x12f/0x3b0 net/netlink/af_netlink.c:2433 genl_rcv+0x23/0x40 net/netlink/genetlink.c:636 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x610 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x639/0xbe0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:656 SYSC_sendto net/socket.c:1763 [inline] SyS_sendto+0x1e4/0x2c0 net/socket.c:1731 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 0: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 rcu_free_wq+0x99/0xf0 kernel/workqueue.c:3279 __rcu_reclaim kernel/rcu/rcu.h:195 [inline] rcu_do_batch kernel/rcu/tree.c:2699 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline] rcu_process_callbacks+0x7a5/0x11e0 kernel/rcu/tree.c:2946 __do_softirq+0x247/0x9a2 kernel/softirq.c:288 The buggy address belongs to the object at ffff8881d81a1c80 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 264 bytes inside of 512-byte region [ffff8881d81a1c80, ffff8881d81a1e80) The buggy address belongs to the page: page:ffffea0007606840 count:1 mapcount:0 mapping:ffff8881d81a1000 index:0xffff8881d81a1c80 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881d81a1000 ffff8881d81a1c80 0000000100000004 raw: ffffea000763f720 ffffea000787c4a0 ffff8881f6000940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d81a1c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d81a1d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d81a1d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d81a1e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d81a1e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================