================================================================== BUG: KASAN: use-after-free in get_kprobe+0xa1/0xc0 kernel/kprobes.c:372 Read of size 8 at addr ffff88800c51b728 by task syz-executor.5/6846 CPU: 1 PID: 6846 Comm: syz-executor.5 Not tainted 5.10.52 #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+0xa1/0xc0 kernel/kprobes.c:372 __recover_optprobed_insn+0x31/0x220 arch/x86/kernel/kprobes/opt.c:44 recover_probed_instruction+0x1c/0xf0 arch/x86/kernel/kprobes/core.c:275 can_probe+0xc7/0x1b0 arch/x86/kernel/kprobes/core.c:303 arch_prepare_kprobe+0x79/0x1b0 arch/x86/kernel/kprobes/core.c:499 prepare_kprobe kernel/kprobes.c:1117 [inline] register_kprobe kernel/kprobes.c:1720 [inline] register_kprobe+0x9af/0x1330 kernel/kprobes.c:1682 __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:1833 perf_kprobe_init+0x18c/0x280 kernel/trace/trace_event_perf.c:272 perf_kprobe_event_init+0xf8/0x1c0 kernel/events/core.c:9595 perf_try_init_event+0x130/0x570 kernel/events/core.c:10973 perf_init_event kernel/events/core.c:11025 [inline] perf_event_alloc.part.0+0xd96/0x2b30 kernel/events/core.c:11303 perf_event_alloc kernel/events/core.c:11682 [inline] __do_sys_perf_event_open+0x57c/0x2d00 kernel/events/core.c:11780 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x466609 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:00007f4b2126c188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 0000000000466609 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020001d80 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffd3e7c91ff R14: 00007f4b2126c300 R15: 0000000000022000 Allocated by task 6319: 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:557 [inline] kzalloc include/linux/slab.h:664 [inline] fib_default_rule_add+0x4e/0x400 net/core/fib_rules.c:60 fib_default_rules_init net/ipv4/fib_rules.c:402 [inline] fib4_rules_init+0xac/0x1c0 net/ipv4/fib_rules.c:417 ip_fib_net_init net/ipv4/fib_frontend.c:1530 [inline] fib_net_init+0x157/0x310 net/ipv4/fib_frontend.c:1583 ops_init net/core/net_namespace.c:152 [inline] setup_net+0x377/0x970 net/core/net_namespace.c:342 copy_net_ns+0x2ca/0x5d0 net/core/net_namespace.c:483 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:231 ksys_unshare+0x445/0x8d0 kernel/fork.c:2958 __do_sys_unshare kernel/fork.c:3032 [inline] __se_sys_unshare kernel/fork.c:3030 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3030 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 ffff88800c51b700 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 40 bytes inside of 192-byte region [ffff88800c51b700, ffff88800c51b7c0) The buggy address belongs to the page: page:00000000c57aa55f refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88800c51b900 pfn:0xc51b flags: 0x100000000000200(slab) raw: 0100000000000200 ffffea0000316308 ffffea000038ab88 ffff888007c41500 raw: ffff88800c51b900 0000000000100003 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88800c51b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800c51b680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88800c51b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88800c51b780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88800c51b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs (loop3): mounted filesystem without journal. Opts: ,errors=continue