================================================================== BUG: KASAN: use-after-free in get_kprobe kernel/kprobes.c:372 [inline] BUG: KASAN: use-after-free in __get_valid_kprobe+0x1ff/0x230 kernel/kprobes.c:1585 Read of size 8 at addr ffff88800f913828 by task syz-executor.2/8661 CPU: 1 PID: 8661 Comm: syz-executor.2 Not tainted 5.10.96 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0+0x1c/0x210 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x37/0x7c mm/kasan/report.c:562 get_kprobe kernel/kprobes.c:372 [inline] __get_valid_kprobe+0x1ff/0x230 kernel/kprobes.c:1585 check_kprobe_rereg kernel/kprobes.c:1606 [inline] register_kprobe+0x119/0x1330 kernel/kprobes.c:1695 __register_trace_kprobe kernel/trace/trace_kprobe.c:514 [inline] __register_trace_kprobe+0x262/0x2d0 kernel/trace/trace_kprobe.c:482 create_local_trace_kprobe+0x1e6/0x3b0 kernel/trace/trace_kprobe.c:1840 perf_kprobe_init+0x18c/0x280 kernel/trace/trace_event_perf.c:272 perf_kprobe_event_init+0xf8/0x1c0 kernel/events/core.c:9655 perf_try_init_event+0x130/0x570 kernel/events/core.c:11033 perf_init_event kernel/events/core.c:11085 [inline] perf_event_alloc.part.0+0xd96/0x2b30 kernel/events/core.c:11363 perf_event_alloc kernel/events/core.c:11742 [inline] __do_sys_perf_event_open+0x57c/0x2d00 kernel/events/core.c:11840 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fdb508a9b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdb4de1f188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fdb509bcf60 RCX: 00007fdb508a9b19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000340 RBP: 00007fdb50903f6d R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc68d6c0ff R14: 00007fdb4de1f300 R15: 0000000000022000 Allocated by task 8537: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] call_usermodehelper_setup+0xa2/0x2f0 kernel/umh.c:363 call_modprobe kernel/kmod.c:93 [inline] __request_module+0x3f5/0x9d0 kernel/kmod.c:170 ctrl_getfamily+0x1e0/0x5a0 net/netlink/genetlink.c:1046 genl_family_rcv_msg_doit+0x22d/0x330 net/netlink/genetlink.c:739 genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0x33c/0x5a0 net/netlink/genetlink.c:800 netlink_rcv_skb+0x14b/0x430 net/netlink/af_netlink.c:2507 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x53a/0x7e0 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x901/0xdf0 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0x150/0x190 net/socket.c:671 netlink: 'syz-executor.0': attribute type 4 has an invalid length. __sys_sendto+0x21c/0x320 net/socket.c:1981 __do_sys_sendto net/socket.c:1993 [inline] __se_sys_sendto net/socket.c:1989 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:1989 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88800f913800 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 40 bytes inside of 192-byte region [ffff88800f913800, ffff88800f9138c0) The buggy address belongs to the page: page:00000000ed651c53 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88800f913800 pfn:0xf913 flags: 0x100000000000200(slab) raw: 0100000000000200 ffffea0000384540 0000000200000002 ffff888007c41500 raw: ffff88800f913800 000000008010000b 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88800f913700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88800f913780: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88800f913800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88800f913880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88800f913900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== general protection fault, probably for non-canonical address 0xef2e892e4eac6cb3: 0000 [#1] SMP KASAN NOPTI KASAN: maybe wild-memory-access in range [0x7974697275636598-0x797469727563659f] CPU: 1 PID: 8661 Comm: syz-executor.2 Tainted: G B 5.10.96 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:get_kprobe kernel/kprobes.c:372 [inline] RIP: 0010:__get_valid_kprobe+0xd5/0x230 kernel/kprobes.c:1585 Code: 85 65 01 00 00 4c 8b 24 dd 80 b5 8e 86 48 bb 00 00 00 00 00 fc ff df eb 41 e8 17 a5 ff ff 49 8d 7c 24 28 48 89 f8 48 c1 e8 03 <80> 3c 18 00 0f 85 1b 01 00 00 4d 3b 6c 24 28 74 3b e8 f5 a4 ff ff RSP: 0018:ffff88804d25fba8 EFLAGS: 00010212 RAX: 0f2e8d2e4eac6cb3 RBX: dffffc0000000000 RCX: ffffc900011f0000 RDX: 0000000000040000 RSI: ffffffff813ffcc9 RDI: 797469727563659b RBP: ffff88804a36e018 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 7974697275636573 R13: ffffffff81000234 R14: ffff88804a36e040 R15: 0000000000000001 FS: 00007fdb4de1f700(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fdb509bd018 CR3: 0000000047ac0000 CR4: 0000000000350ee0 Call Trace: check_kprobe_rereg kernel/kprobes.c:1606 [inline] register_kprobe+0x119/0x1330 kernel/kprobes.c:1695 __register_trace_kprobe kernel/trace/trace_kprobe.c:514 [inline] __register_trace_kprobe+0x262/0x2d0 kernel/trace/trace_kprobe.c:482 create_local_trace_kprobe+0x1e6/0x3b0 kernel/trace/trace_kprobe.c:1840 perf_kprobe_init+0x18c/0x280 kernel/trace/trace_event_perf.c:272 perf_kprobe_event_init+0xf8/0x1c0 kernel/events/core.c:9655 perf_try_init_event+0x130/0x570 kernel/events/core.c:11033 perf_init_event kernel/events/core.c:11085 [inline] perf_event_alloc.part.0+0xd96/0x2b30 kernel/events/core.c:11363 perf_event_alloc kernel/events/core.c:11742 [inline] __do_sys_perf_event_open+0x57c/0x2d00 kernel/events/core.c:11840 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fdb508a9b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdb4de1f188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fdb509bcf60 RCX: 00007fdb508a9b19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000340 RBP: 00007fdb50903f6d R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc68d6c0ff R14: 00007fdb4de1f300 R15: 0000000000022000 Modules linked in: ---[ end trace 1e4ee2142230b7fa ]--- RIP: 0010:get_kprobe kernel/kprobes.c:372 [inline] RIP: 0010:__get_valid_kprobe+0xd5/0x230 kernel/kprobes.c:1585 Code: 85 65 01 00 00 4c 8b 24 dd 80 b5 8e 86 48 bb 00 00 00 00 00 fc ff df eb 41 e8 17 a5 ff ff 49 8d 7c 24 28 48 89 f8 48 c1 e8 03 <80> 3c 18 00 0f 85 1b 01 00 00 4d 3b 6c 24 28 74 3b e8 f5 a4 ff ff RSP: 0018:ffff88804d25fba8 EFLAGS: 00010212 RAX: 0f2e8d2e4eac6cb3 RBX: dffffc0000000000 RCX: ffffc900011f0000 RDX: 0000000000040000 RSI: ffffffff813ffcc9 RDI: 797469727563659b RBP: ffff88804a36e018 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 7974697275636573 R13: ffffffff81000234 R14: ffff88804a36e040 R15: 0000000000000001 FS: 00007fdb4de1f700(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fdb509bd018 CR3: 0000000047ac0000 CR4: 0000000000350ee0 EXT4-fs (loop4): Unrecognized mount option "€" or missing value EXT4-fs (loop4): Unrecognized mount option "€" or missing value cgroup: fork rejected by pids controller in /syz7 ---------------- Code disassembly (best guess): 0: 85 65 01 test %esp,0x1(%rbp) 3: 00 00 add %al,(%rax) 5: 4c 8b 24 dd 80 b5 8e mov -0x79714a80(,%rbx,8),%r12 c: 86 d: 48 bb 00 00 00 00 00 movabs $0xdffffc0000000000,%rbx 14: fc ff df 17: eb 41 jmp 0x5a 19: e8 17 a5 ff ff callq 0xffffa535 1e: 49 8d 7c 24 28 lea 0x28(%r12),%rdi 23: 48 89 f8 mov %rdi,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 80 3c 18 00 cmpb $0x0,(%rax,%rbx,1) <-- trapping instruction 2e: 0f 85 1b 01 00 00 jne 0x14f 34: 4d 3b 6c 24 28 cmp 0x28(%r12),%r13 39: 74 3b je 0x76 3b: e8 f5 a4 ff ff callq 0xffffa535