================================================================== 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 ffff8880998e4f60 by task syz-executor.1/28122 CPU: 0 PID: 28122 Comm: syz-executor.1 Not tainted 4.14.213-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:ffff888050f67a78 EFLAGS: 00010206 RAX: ffffed100a24d000 RBX: 0000000000003b17 RCX: 0000000000001acb RDX: 0000000000003b17 RSI: 0000000020f34000 RDI: ffff888051266535 RBP: 0000000020f31fb4 R08: 0000000000000001 R09: ffffed100a24cfff R10: ffff888051267fff R11: 0000000000000000 R12: ffff8880512644e9 R13: 00007ffffffff000 R14: 0000000020f35acb R15: ffff8880512644e9 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:0x45e219 RSP: 002b:00007fdef2f48c68 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 000000000045e219 RDX: ffffffffffffffef RSI: 0000000020d7cfcb RDI: 0000000000000006 RBP: 000000000119bfd8 R08: 0000000000000000 R09: 0000000000000053 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c R13: 00007ffd67e7edff R14: 00007fdef2f499c0 R15: 000000000119bf8c Allocated by task 4631: 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] kernfs_fop_open+0x266/0xc40 fs/kernfs/file.c:648 do_dentry_open+0x44b/0xec0 fs/open.c:777 vfs_open+0x105/0x220 fs/open.c:888 do_last fs/namei.c:3428 [inline] path_openat+0x628/0x2970 fs/namei.c:3569 do_filp_open+0x179/0x3c0 fs/namei.c:3603 do_sys_open+0x296/0x410 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 4631: 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 kernfs_fop_release+0x10e/0x180 fs/kernfs/file.c:783 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880998e4c80 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 224 bytes to the right of 512-byte region [ffff8880998e4c80, ffff8880998e4e80) The buggy address belongs to the page: page:ffffea0002663900 count:1 mapcount:0 mapping:ffff8880998e4000 index:0xffff8880998e4500 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffff8880998e4000 ffff8880998e4500 0000000100000004 raw: ffffea00025a7fa0 ffffea000179e0a0 ffff88813fe80940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880998e4e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880998e4e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880998e4f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880998e4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880998e5000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================