bisecting fixing commit since 69b94dd6dcd14d9bfcba35a492f5e27c15cf4d0a building syzkaller on cb93dc6ac64225e09f44bac6c6cce1dae1b248b0 testing commit 69b94dd6dcd14d9bfcba35a492f5e27c15cf4d0a with gcc (GCC) 8.1.0 kernel signature: 776de4abba9ef9f905d9f548cbf063eb7fad8d51045c268a0e1698ef30db6f66 run #0: crashed: KASAN: use-after-free Read in perf_output_read run #1: crashed: INFO: rcu detected stall in corrupted 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: OK run #6: OK run #7: OK run #8: OK run #9: OK testing current HEAD 8961076ed318dfd22aa357b41589f07bf67e73b6 testing commit 8961076ed318dfd22aa357b41589f07bf67e73b6 with gcc (GCC) 8.1.0 kernel signature: a969e843509a179c3d11eb8ee55a09663821c862aac42150e6971b537d4262f9 run #0: crashed: KASAN: use-after-free Read in perf_output_read run #1: crashed: KASAN: slab-out-of-bounds Read in perf_output_read run #2: crashed: KASAN: slab-out-of-bounds Read in perf_output_read run #3: crashed: KASAN: slab-out-of-bounds 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: OK run #7: OK run #8: OK run #9: OK revisions tested: 2, total time: 37m59.324567031s (build: 16m16.146076937s, test: 20m57.39683255s) the crash still happens on HEAD commit msg: Linux 4.14.207 crash: KASAN: use-after-free Read in perf_output_read ================================================================== 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+0x118d/0x1500 kernel/events/core.c:5930 Read of size 8 at addr ffff8880ac83ed20 by task syz-executor.4/23349 CPU: 1 PID: 23349 Comm: syz-executor.4 Not tainted 4.14.207-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/0x1f1 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.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 perf_output_read_group kernel/events/core.c:5895 [inline] perf_output_read+0x118d/0x1500 kernel/events/core.c:5930 perf_output_sample+0x128c/0x1930 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/0x3fb 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:ffff888087c37928 EFLAGS: 00010206 RAX: 0000000000000000 RBX: 0000000020fe1d6d RCX: 0000000000001acb RDX: 0000000000003d5e RSI: 0000000020fe4000 RDI: ffff888095b46535 RBP: ffff888087c37950 R08: 0000000000000000 R09: 00000000000000f5 R10: ffffed1012b68fff R11: ffff888095b47fff R12: ffff888095b442a2 R13: ffff888096cbe680 R14: ffff888087c37db0 R15: ffff888087c37d60 _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+0xa02/0x3be0 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:0x45c369 RSP: 002b:00007fa016817c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000000000002ba00 RCX: 000000000045c369 RDX: ffffffffffffffef RSI: 0000000020d7cfcb RDI: 0000000000000006 RBP: 000000000078bf58 R08: 0000000000000000 R09: 0000000000000053 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c R13: 00007ffc9cd950bf R14: 00007fa0168189c0 R15: 000000000078bf0c Allocated by task 6488: 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_node mm/slab.c:3682 [inline] __kmalloc_node_track_caller+0x50/0x70 mm/slab.c:3696 __kmalloc_reserve.isra.7+0x2c/0xc0 net/core/skbuff.c:137 __alloc_skb+0xc1/0x540 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:980 [inline] nlmsg_new include/net/netlink.h:511 [inline] __neigh_notify+0x87/0x130 net/core/neighbour.c:2927 neigh_cleanup_and_release+0x65/0xa0 net/core/neighbour.c:106 neigh_del+0x13b/0x1c0 net/core/neighbour.c:141 neigh_forced_gc net/core/neighbour.c:190 [inline] neigh_alloc net/core/neighbour.c:315 [inline] __neigh_create+0xb91/0x1810 net/core/neighbour.c:499 ip6_finish_output2+0x7fd/0x2070 net/ipv6/ip6_output.c:117 ip6_finish_output+0x56d/0xa50 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip6_output+0x1b3/0x610 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:470 [inline] NF_HOOK include/linux/netfilter.h:250 [inline] ndisc_send_skb+0x80e/0x1240 net/ipv6/ndisc.c:483 ndisc_send_rs+0x116/0x5e0 net/ipv6/ndisc.c:677 addrconf_rs_timer+0x23f/0x590 net/ipv6/addrconf.c:3765 call_timer_fn+0x142/0x570 kernel/time/timer.c:1280 expire_timers+0x299/0x440 kernel/time/timer.c:1319 __run_timers kernel/time/timer.c:1637 [inline] run_timer_softirq+0x1cd/0x540 kernel/time/timer.c:1650 __do_softirq+0x246/0x9b5 kernel/softirq.c:288 Freed by task 6488: 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 skb_free_head+0x74/0x90 net/core/skbuff.c:554 skb_release_data+0x4e0/0x820 net/core/skbuff.c:574 skb_release_all+0x3d/0x50 net/core/skbuff.c:631 __kfree_skb net/core/skbuff.c:645 [inline] consume_skb+0x84/0x2a0 net/core/skbuff.c:705 netlink_broadcast_filtered+0x274/0x8e0 net/netlink/af_netlink.c:1489 netlink_broadcast+0xe/0x10 net/netlink/af_netlink.c:1511 nlmsg_multicast include/net/netlink.h:591 [inline] nlmsg_notify+0x6e/0x110 net/netlink/af_netlink.c:2476 rtnl_notify+0x86/0xe0 net/core/rtnetlink.c:653 __neigh_notify+0xcb/0x130 net/core/neighbour.c:2938 neigh_cleanup_and_release+0x65/0xa0 net/core/neighbour.c:106 neigh_del+0x13b/0x1c0 net/core/neighbour.c:141 neigh_forced_gc net/core/neighbour.c:190 [inline] neigh_alloc net/core/neighbour.c:315 [inline] __neigh_create+0xb91/0x1810 net/core/neighbour.c:499 ip6_finish_output2+0x7fd/0x2070 net/ipv6/ip6_output.c:117 ip6_finish_output+0x56d/0xa50 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip6_output+0x1b3/0x610 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:470 [inline] NF_HOOK include/linux/netfilter.h:250 [inline] ndisc_send_skb+0x80e/0x1240 net/ipv6/ndisc.c:483 ndisc_send_rs+0x116/0x5e0 net/ipv6/ndisc.c:677 addrconf_rs_timer+0x23f/0x590 net/ipv6/addrconf.c:3765 call_timer_fn+0x142/0x570 kernel/time/timer.c:1280 expire_timers+0x299/0x440 kernel/time/timer.c:1319 __run_timers kernel/time/timer.c:1637 [inline] run_timer_softirq+0x1cd/0x540 kernel/time/timer.c:1650 __do_softirq+0x246/0x9b5 kernel/softirq.c:288 The buggy address belongs to the object at ffff8880ac83ecc0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 96 bytes inside of 512-byte region [ffff8880ac83ecc0, ffff8880ac83eec0) The buggy address belongs to the page: page:ffffea0002b20f80 count:1 mapcount:0 mapping:ffff8880ac83e040 index:0xffff8880ac83e040 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff8880ac83e040 ffff8880ac83e040 0000000100000004 raw: ffffea00025957a0 ffffea00029b9d20 ffff8880b6400940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880ac83ec00: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880ac83ec80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8880ac83ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880ac83ed80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880ac83ee00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================