================================================================== 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:5896 [inline] BUG: KASAN: slab-out-of-bounds in perf_output_read+0x1046/0x1090 kernel/events/core.c:5931 Read of size 8 at addr ffff8880a747a260 by task syz-executor.0/9947 CPU: 0 PID: 9947 Comm: syz-executor.0 Not tainted 4.14.303-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x191 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:5896 [inline] perf_output_read+0x1046/0x1090 kernel/events/core.c:5931 perf_output_sample+0xa28/0x1700 kernel/events/core.c:5973 __perf_event_output kernel/events/core.c:6292 [inline] perf_event_output_forward+0xf8/0x1f0 kernel/events/core.c:6305 __perf_event_overflow+0x113/0x310 kernel/events/core.c:7554 perf_swevent_overflow kernel/events/core.c:7630 [inline] perf_swevent_event+0x299/0x460 kernel/events/core.c:7658 do_perf_sw_event kernel/events/core.c:7771 [inline] ___perf_sw_event+0x2ac/0x490 kernel/events/core.c:7802 __perf_sw_event+0x4f/0x100 kernel/events/core.c:7814 perf_sw_event include/linux/perf_event.h:1048 [inline] __do_page_fault+0x692/0xad0 arch/x86/mm/fault.c:1483 page_fault+0x25/0x50 arch/x86/entry/entry_64.S:1126 RIP: 0010:copy_user_enhanced_fast_string+0xe/0x20 arch/x86/lib/copy_user_64.S:181 RSP: 0018:ffff888072a4fa60 EFLAGS: 00050206 RAX: ffffed100e4c2000 RBX: 0000000000008000 RCX: 0000000000004acb RDX: 0000000000008000 RSI: 0000000020ff9000 RDI: ffff88807260b535 RBP: 0000000020ff5acb R08: 0000000000000001 R09: ffffed100e4c1fff R10: ffff88807260ffff R11: 0000000000000000 R12: ffff888072608000 R13: 00007ffffffff000 R14: 0000000020ffdacb R15: ffff8880a8c24d40 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+0x19c/0x760 lib/iov_iter.c:610 copy_from_iter_full include/linux/uio.h:126 [inline] skb_do_copy_data_nocache include/net/sock.h:1892 [inline] skb_copy_to_page_nocache include/net/sock.h:1918 [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+0x5e/0xd3 RIP: 0033:0x7f7e028bf0c9 RSP: 002b:00007f7e00e31168 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f7e029def80 RCX: 00007f7e028bf0c9 RDX: ffffffffffffffef RSI: 0000000020d7cfcb RDI: 0000000000000007 RBP: 00007f7e0291aae9 R08: 0000000000000000 R09: 0000000000000053 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeb272e30f R14: 00007f7e00e31300 R15: 0000000000022000 Allocated by task 8032: 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:640 kernfs_new_node+0x7b/0xe0 fs/kernfs/dir.c:685 __kernfs_create_file+0x3d/0x320 fs/kernfs/file.c:989 sysfs_add_file_mode_ns+0x1e1/0x450 fs/sysfs/file.c:308 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/0x130 fs/sysfs/group.c:173 device_add_groups drivers/base/core.c:1064 [inline] device_add_attrs drivers/base/core.c:1223 [inline] device_add+0x11c0/0x15c0 drivers/base/core.c:1902 netdev_register_kobject+0x181/0x410 net/core/net-sysfs.c:1627 register_netdevice+0x955/0xe50 net/core/dev.c:7668 rtnl_newlink+0x14e6/0x1830 net/core/rtnetlink.c:2744 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454 netlink_unicast_kernel net/netlink/af_netlink.c:1296 [inline] netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1322 netlink_sendmsg+0x648/0xbc0 net/netlink/af_netlink.c:1893 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+0x5e/0xd3 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8880a747a1c0 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 [ffff8880a747a1c0, ffff8880a747a260) The buggy address belongs to the page: page:ffffea00029d1e80 count:1 mapcount:0 mapping:ffff8880a747a000 index:0xffff8880a747afee flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffff8880a747a000 ffff8880a747afee 0000000100000012 raw: ffffea00024b52e0 ffffea00029d1ee0 ffff88823f8c1680 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a747a100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a747a180: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 >ffff8880a747a200: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ^ ffff8880a747a280: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a747a300: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================