================================================================== 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 ffff88809d4bd260 by task syz-executor.5/18662 CPU: 0 PID: 18662 Comm: syz-executor.5 Not tainted 4.14.212-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:ffff888071237a78 EFLAGS: 00010202 RAX: ffffed100e2e1000 RBX: 0000000000003bb6 RCX: 0000000000001acb RDX: 0000000000003bb6 RSI: 0000000020f64000 RDI: ffff888071706535 RBP: 0000000020f61f15 R08: 0000000000000001 R09: ffffed100e2e0fff R10: ffff888071707fff R11: 0000000000000000 R12: ffff88807170444a R13: 00007ffffffff000 R14: 0000000020f65acb R15: ffff88807170444a 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:0x45e299 RSP: 002b:00007f5b16fe5c68 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 000000000045e299 RDX: ffffffffffffffef RSI: 0000000020d7cfcb RDI: 0000000000000006 RBP: 000000000119bfd8 R08: 0000000000000000 R09: 0000000000000053 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c R13: 00007ffe8b217fef R14: 00007f5b16fe69c0 R15: 000000000119bf8c Allocated by task 7991: 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+0x124/0x3c0 mm/slab.c:3552 kmem_cache_zalloc include/linux/slab.h:651 [inline] __kernfs_new_node+0x6f/0x470 fs/kernfs/dir.c:632 kernfs_new_node+0x7b/0xe0 fs/kernfs/dir.c:677 __kernfs_create_file+0x3d/0x320 fs/kernfs/file.c:989 sysfs_add_file_mode_ns+0x1e1/0x450 fs/sysfs/file.c:307 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x22b/0x710 fs/sysfs/group.c:134 sysfs_create_group fs/sysfs/group.c:156 [inline] sysfs_create_groups fs/sysfs/group.c:183 [inline] sysfs_create_groups+0x92/0x127 fs/sysfs/group.c:173 device_add_groups drivers/base/core.c:1049 [inline] device_add_attrs drivers/base/core.c:1197 [inline] device_add+0x7e5/0x15c0 drivers/base/core.c:1886 netdev_register_kobject+0x181/0x410 net/core/net-sysfs.c:1608 register_netdevice+0x955/0xe40 net/core/dev.c:7660 macvlan_common_newlink+0xb5a/0x1480 drivers/net/macvlan.c:1436 macvtap_newlink drivers/net/macvtap.c:108 [inline] macvtap_newlink+0x17b/0x230 drivers/net/macvtap.c:80 rtnl_newlink+0xf88/0x1830 net/core/rtnetlink.c:2728 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 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff88809d4bd1c0 which belongs to the cache kernfs_node_cache of size 160 The buggy address is located 0 bytes to the right of 160-byte region [ffff88809d4bd1c0, ffff88809d4bd260) The buggy address belongs to the page: page:ffffea0002752f40 count:1 mapcount:0 mapping:ffff88809d4bd000 index:0xffff88809d4bdfee flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffff88809d4bd000 ffff88809d4bdfee 0000000100000012 raw: ffffea0002d5dc60 ffffea0002752fa0 ffff88823f8bb680 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809d4bd100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88809d4bd180: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 >ffff88809d4bd200: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ^ ffff88809d4bd280: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 ffff88809d4bd300: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================