bisecting fixing commit since 69b94dd6dcd14d9bfcba35a492f5e27c15cf4d0a building syzkaller on cb93dc6ac64225e09f44bac6c6cce1dae1b248b0 testing commit 69b94dd6dcd14d9bfcba35a492f5e27c15cf4d0a with gcc (GCC) 8.1.0 kernel signature: e67eb7a6facdd64325f6ae4fc2a0a5d6730d19df520d611f3b0c227a1b3efb74 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: crashed: KASAN: slab-out-of-bounds Read in perf_output_read run #6: OK run #7: OK run #8: OK run #9: OK testing current HEAD 5b7a52cd2eef952cee8a72512ef370bcdef46636 testing commit 5b7a52cd2eef952cee8a72512ef370bcdef46636 with gcc (GCC) 8.1.0 kernel signature: 7d41a5d091671dd5cf65ee4446f2fbf8747489cd5fafbf4c03fda077b1c4bad3 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: INFO: rcu detected stall in corrupted run #4: crashed: KASAN: use-after-free Read in perf_output_read run #5: crashed: KASAN: slab-out-of-bounds Read in perf_output_read run #6: OK run #7: OK run #8: OK run #9: OK revisions tested: 2, total time: 41m10.257087288s (build: 17m41.081252183s, test: 22m27.238932909s) the crash still happens on HEAD commit msg: Linux 4.14.202 crash: KASAN: slab-out-of-bounds 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: slab-out-of-bounds in perf_output_read_group kernel/events/core.c:5894 [inline] BUG: KASAN: slab-out-of-bounds in perf_output_read+0x1197/0x1500 kernel/events/core.c:5929 Read of size 8 at addr ffff8880a573b648 by task syz-executor328/25127 CPU: 1 PID: 25127 Comm: syz-executor328 Not tainted 4.14.202-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:5894 [inline] perf_output_read+0x1197/0x1500 kernel/events/core.c:5929 perf_output_sample+0x128c/0x1930 kernel/events/core.c:5971 __perf_event_output kernel/events/core.c:6284 [inline] perf_event_output_forward+0x103/0x1d0 kernel/events/core.c:6297 __perf_event_overflow+0x107/0x300 kernel/events/core.c:7542 perf_swevent_overflow+0x165/0x210 kernel/events/core.c:7618 perf_swevent_event+0x1f5/0x2f0 kernel/events/core.c:7651 do_perf_sw_event kernel/events/core.c:7759 [inline] ___perf_sw_event+0x26b/0x3f0 kernel/events/core.c:7790 __perf_sw_event+0x3c/0x60 kernel/events/core.c:7802 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:ffff8880794ef928 EFLAGS: 00010206 RAX: 0000000000000000 RBX: 0000000020e5dacb RCX: 0000000000001265 RDX: 000000000000479a RSI: 0000000020e61000 RDI: ffff888094a73535 RBP: ffff8880794ef950 R08: ffffed101294e8f4 R09: ffffed101294e8f4 R10: ffffed101294e8f3 R11: ffff888094a74799 R12: ffff888094a70000 R13: ffff888090888280 R14: ffff8880794efdb0 R15: ffff8880794efd60 _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:0x44a199 RSP: 002b:00007f56993e4da8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00000000006e59e8 RCX: 000000000044a199 RDX: ffffffffffffffef RSI: 0000000020d7cfcb RDI: 0000000000000006 RBP: 00000000006e59e0 R08: 0000000000000000 R09: 0000000000000053 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006e59ec R13: 00007ffec22bc17f R14: 00007f56993e59c0 R15: 0000000000000064 Allocated by task 22843: 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] new_dir fs/proc/proc_sysctl.c:945 [inline] get_subdir fs/proc/proc_sysctl.c:990 [inline] __register_sysctl_table+0x6ac/0xde0 fs/proc/proc_sysctl.c:1333 register_net_sysctl+0x10/0x20 net/sysctl_net.c:120 mpls_dev_sysctl_register+0x1a9/0x290 net/mpls/af_mpls.c:1337 mpls_add_dev net/mpls/af_mpls.c:1388 [inline] mpls_dev_notify+0x1cf/0x5c0 net/mpls/af_mpls.c:1510 notifier_call_chain+0xd6/0x150 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x11/0x20 kernel/notifier.c:401 call_netdevice_notifiers_info+0x4b/0x60 net/core/dev.c:1667 call_netdevice_notifiers net/core/dev.c:1683 [inline] register_netdevice+0x98c/0xe50 net/core/dev.c:7691 veth_newlink+0x406/0x970 drivers/net/veth.c:416 rtnl_newlink+0xc2b/0x13a0 net/core/rtnetlink.c:2728 rtnetlink_rcv_msg+0x34c/0x9e0 net/core/rtnetlink.c:4316 netlink_rcv_skb+0x12f/0x3b0 net/netlink/af_netlink.c:2433 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4328 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x610 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x657/0xc60 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 6481: 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_unicast_kernel net/netlink/af_netlink.c:1288 [inline] netlink_unicast+0x413/0x610 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x657/0xc60 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 The buggy address belongs to the object at ffff8880a573b540 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 264 bytes inside of 512-byte region [ffff8880a573b540, ffff8880a573b740) The buggy address belongs to the page: page:ffffea000295cec0 count:1 mapcount:0 mapping:ffff8880a573b040 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff8880a573b040 0000000000000000 0000000100000006 raw: ffffea0002833ca0 ffffea0002279ea0 ffff8880aa800940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a573b500: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880a573b580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880a573b600: 00 00 00 00 00 00 00 00 06 fc fc fc fc fc fc fc ^ ffff8880a573b680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a573b700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================