================================================================== BUG: KASAN: slab-out-of-bounds in primary_event_id kernel/events/core.c:1316 [inline] BUG: KASAN: slab-out-of-bounds in perf_output_read_group kernel/events/core.c:5895 [inline] BUG: KASAN: slab-out-of-bounds in perf_output_read+0x1046/0x1090 kernel/events/core.c:5930 Read of size 8 at addr ffff888092bfcfa0 by task syz-executor.3/10154 CPU: 1 PID: 10154 Comm: syz-executor.3 Not tainted 4.14.211-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+0x1b2/0x283 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351 kasan_report mm/kasan/report.c:409 [inline] __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430 primary_event_id kernel/events/core.c:1316 [inline] perf_output_read_group kernel/events/core.c:5895 [inline] perf_output_read+0x1046/0x1090 kernel/events/core.c:5930 perf_output_sample+0xa28/0x16f0 kernel/events/core.c:5972 __perf_event_output kernel/events/core.c:6285 [inline] perf_event_output_forward+0xf8/0x1f0 kernel/events/core.c:6298 __perf_event_overflow+0x113/0x310 kernel/events/core.c:7547 perf_swevent_overflow kernel/events/core.c:7623 [inline] perf_swevent_event+0x299/0x460 kernel/events/core.c:7651 do_perf_sw_event kernel/events/core.c:7764 [inline] ___perf_sw_event+0x2a1/0x480 kernel/events/core.c:7795 __perf_sw_event+0x4f/0x100 kernel/events/core.c:7807 perf_sw_event include/linux/perf_event.h:1046 [inline] __do_page_fault+0x692/0xad0 arch/x86/mm/fault.c:1483 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:ffff88805561fa78 EFLAGS: 00010206 RAX: ffffed100968d86f RBX: 0000000000004376 RCX: 0000000000002e41 RDX: 0000000000004376 RSI: 0000000020f9f000 RDI: ffff88804b469535 RBP: 0000000020f9dacb R08: 0000000000000001 R09: ffffed100968d86e R10: ffff88804b46c375 R11: 0000000000000000 R12: ffff88804b468000 R13: 00007ffffffff000 R14: 0000000020fa1e41 R15: ffff88804b468000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:55 [inline] copyin+0x99/0xc0 lib/iov_iter.c:146 _copy_from_iter_full+0x197/0x690 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+0x23fc/0x2ef0 net/ipv4/tcp.c:1360 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457 inet_sendmsg+0x11a/0x4e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 SYSC_sendto net/socket.c:1763 [inline] SyS_sendto+0x1c7/0x2c0 net/socket.c:1731 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45e0f9 RSP: 002b:00007fb42db6ec68 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 000000000045e0f9 RDX: ffffffffffffffef RSI: 0000000020d7cfcb RDI: 0000000000000007 RBP: 000000000119bfd8 R08: 0000000000000000 R09: 0000000000000053 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c R13: 00007fff66470b8f R14: 00007fb42db6f9c0 R15: 000000000119bf8c Allocated by task 10155: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] alloc_perf_context+0x46/0x310 kernel/events/core.c:3865 find_get_context.isra.0+0x109/0x530 kernel/events/core.c:3954 SYSC_perf_event_open kernel/events/core.c:10179 [inline] SyS_perf_event_open+0x96e/0x24b0 kernel/events/core.c:10010 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 8022: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xc9/0x250 mm/slab.c:3815 skb_free_head net/core/skbuff.c:554 [inline] skb_release_data+0x5f6/0x820 net/core/skbuff.c:574 skb_release_all net/core/skbuff.c:631 [inline] __kfree_skb net/core/skbuff.c:645 [inline] consume_skb+0xe0/0x380 net/core/skbuff.c:705 netlink_broadcast_filtered+0x2ab/0x9e0 net/netlink/af_netlink.c:1489 netlink_broadcast net/netlink/af_netlink.c:1511 [inline] nlmsg_multicast include/net/netlink.h:591 [inline] nlmsg_notify+0x126/0x170 net/netlink/af_netlink.c:2476 rtmsg_fib+0x364/0x4c0 net/ipv4/fib_semantics.c:428 fib_table_insert+0x69c/0x1330 net/ipv4/fib_trie.c:1278 fib_magic+0x328/0x460 net/ipv4/fib_frontend.c:861 fib_add_ifaddr+0x2e3/0x450 net/ipv4/fib_frontend.c:895 fib_netdev_event+0x399/0x4d0 net/ipv4/fib_frontend.c:1211 notifier_call_chain+0x108/0x1a0 kernel/notifier.c:93 call_netdevice_notifiers_info net/core/dev.c:1667 [inline] call_netdevice_notifiers net/core/dev.c:1683 [inline] __dev_notify_flags+0xdf/0x260 net/core/dev.c:6832 dev_change_flags+0xe6/0x130 net/core/dev.c:6865 do_setlink+0x83f/0x2bf0 net/core/rtnetlink.c:2092 rtnl_newlink+0x1267/0x1830 net/core/rtnetlink.c:2660 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4316 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 SYSC_sendto net/socket.c:1763 [inline] SyS_sendto+0x1c7/0x2c0 net/socket.c:1731 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff888092bfccc0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 224 bytes to the right of 512-byte region [ffff888092bfccc0, ffff888092bfcec0) The buggy address belongs to the page: page:ffffea00024aff00 count:1 mapcount:0 mapping:ffff888092bfc040 index:0xffff888092bfc2c0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffff888092bfc040 ffff888092bfc2c0 0000000100000005 raw: ffffea00029976e0 ffffea0002713920 ffff88813fe80940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888092bfce80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888092bfcf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888092bfcf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888092bfd000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888092bfd080: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc ==================================================================