netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'. ================================================================== BUG: KASAN: use-after-free in get_kprobe+0xa1/0xc0 kernel/kprobes.c:372 Read of size 8 at addr ffff888013bdec28 by task syz-executor.2/17198 CPU: 1 PID: 17198 Comm: syz-executor.2 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:00007fb032338188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 0000000000466609 RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000020001d80 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffe698badff R14: 00007fb032338300 R15: 0000000000022000 Allocated by task 17199: 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] alloc_aggr_kprobe+0x41/0x190 kernel/kprobes.c:822 try_to_optimize_kprobe kernel/kprobes.c:853 [inline] register_kprobe kernel/kprobes.c:1740 [inline] register_kprobe+0xb78/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 Freed by task 16660: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0x110/0x150 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1542 [inline] slab_free_freelist_hook+0x64/0x150 mm/slub.c:1575 slab_free mm/slub.c:3140 [inline] kfree+0xca/0x360 mm/slub.c:4116 free_aggr_kprobe kernel/kprobes.c:434 [inline] do_free_cleaned_kprobes kernel/kprobes.c:586 [inline] kprobe_optimizer+0x56f/0x7e0 kernel/kprobes.c:624 process_one_work+0x9a9/0x1590 kernel/workqueue.c:2270 worker_thread+0x61d/0x1310 kernel/workqueue.c:2416 kthread+0x38f/0x470 kernel/kthread.c:292 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:296 Last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x9e/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2960 [inline] call_rcu+0x8a/0xa20 kernel/rcu/tree.c:3034 neigh_parms_release net/core/neighbour.c:1670 [inline] neigh_parms_release+0x178/0x1d0 net/core/neighbour.c:1660 inetdev_destroy net/ipv4/devinet.c:325 [inline] inetdev_event+0x1007/0x1550 net/ipv4/devinet.c:1599 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xb3/0x110 kernel/notifier.c:410 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2047 call_netdevice_notifiers_extack net/core/dev.c:2059 [inline] call_netdevice_notifiers net/core/dev.c:2073 [inline] rollback_registered_many+0x83d/0x1270 net/core/dev.c:9520 unregister_netdevice_many.part.0+0x18/0x220 net/core/dev.c:10729 unregister_netdevice_many net/core/dev.c:10728 [inline] default_device_exit_batch+0x321/0x3e0 net/core/dev.c:11212 ops_exit_list+0x113/0x160 net/core/net_namespace.c:190 cleanup_net+0x484/0x8e0 net/core/net_namespace.c:604 process_one_work+0x9a9/0x1590 kernel/workqueue.c:2270 worker_thread+0x61d/0x1310 kernel/workqueue.c:2416 kthread+0x38f/0x470 kernel/kthread.c:292 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:296 Second to last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x9e/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2960 [inline] call_rcu+0x8a/0xa20 kernel/rcu/tree.c:3034 neigh_parms_release net/core/neighbour.c:1670 [inline] neigh_parms_release+0x178/0x1d0 net/core/neighbour.c:1660 addrconf_ifdown.isra.0+0xf43/0x14e0 net/ipv6/addrconf.c:3847 addrconf_notify+0x159/0x22f0 net/ipv6/addrconf.c:3628 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xb3/0x110 kernel/notifier.c:410 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2047 call_netdevice_notifiers_extack net/core/dev.c:2059 [inline] call_netdevice_notifiers net/core/dev.c:2073 [inline] rollback_registered_many+0x83d/0x1270 net/core/dev.c:9520 rollback_registered net/core/dev.c:9565 [inline] unregister_netdevice_queue+0x1fd/0x420 net/core/dev.c:10710 unregister_netdevice include/linux/netdevice.h:2868 [inline] __tun_detach+0xfa8/0x1240 drivers/net/tun.c:681 tun_detach drivers/net/tun.c:698 [inline] tun_chr_close+0xc4/0x180 drivers/net/tun.c:3445 __fput+0x285/0x980 fs/file_table.c:281 task_work_run+0xe2/0x1a0 kernel/task_work.c:151 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:164 [inline] exit_to_user_mode_prepare+0x155/0x160 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x38/0x230 kernel/entry/common.c:266 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888013bdec00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 40 bytes inside of 192-byte region [ffff888013bdec00, ffff888013bdecc0) The buggy address belongs to the page: page:0000000000db3a75 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13bde flags: 0x100000000000200(slab) raw: 0100000000000200 ffffea00001ff080 0000000800000008 ffff888007c41500 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888013bdeb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888013bdeb80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888013bdec00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888013bdec80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888013bded00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== netlink: 4 bytes leftover after parsing attributes in process `syz-executor.6'. EXT4-fs error (device loop6): ext4_fill_super:4954: inode #2: comm syz-executor.6: iget: root inode unallocated EXT4-fs (loop6): get root inode failed EXT4-fs (loop6): mount failed EXT4-fs error (device loop6): ext4_fill_super:4954: inode #2: comm syz-executor.6: iget: root inode unallocated EXT4-fs (loop6): get root inode failed EXT4-fs (loop6): mount failed