==================================================================
BUG: KASAN: slab-use-after-free in fib_rules_lookup+0x15e/0xeb0 net/core/fib_rules.c:321
Read of size 8 at addr ffff888064abb780 by task syz.3.6193/29029
CPU: 0 UID: 0 PID: 29029 Comm: syz.3.6193 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_address_description+0x55/0x1e0 mm/kasan/report.c:378
print_report+0x58/0x70 mm/kasan/report.c:482
kasan_report+0x117/0x150 mm/kasan/report.c:595
fib_rules_lookup+0x15e/0xeb0 net/core/fib_rules.c:321
__fib_lookup+0x106/0x210 net/ipv4/fib_rules.c:96
ip_route_output_key_hash_rcu+0x294/0x2720 net/ipv4/route.c:2811
ip_route_output_key_hash+0x18d/0x2a0 net/ipv4/route.c:2702
icmp_route_lookup+0x50a/0xb50 net/ipv4/icmp.c:520
__icmp_send+0x1010/0x1710 net/ipv4/icmp.c:958
ipv4_send_dest_unreach net/ipv4/route.c:1253 [inline]
ipv4_link_failure+0x64d/0xa50 net/ipv4/route.c:1260
dst_link_failure include/net/dst.h:438 [inline]
arp_error_report+0x118/0x160 net/ipv4/arp.c:296
neigh_invalidate+0x243/0x470 net/core/neighbour.c:1077
neigh_timer_handler+0xc01/0x12b0 net/core/neighbour.c:1169
call_timer_fn+0x192/0x5e0 kernel/time/timer.c:1748
expire_timers kernel/time/timer.c:1799 [inline]
__run_timers kernel/time/timer.c:2374 [inline]
__run_timer_base+0x652/0x8b0 kernel/time/timer.c:2386
run_timer_base kernel/time/timer.c:2395 [inline]
run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2405
handle_softirqs+0x225/0x840 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xca/0x220 kernel/softirq.c:735
irq_exit_rcu+0x9/0x30 kernel/softirq.c:752
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1061 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1061
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:lockdep_unregister_key+0x2d5/0x350 kernel/locking/lockdep.c:6616
Code: 91 03 09 00 89 c6 48 c7 c7 30 48 40 96 e8 03 e8 06 0a 90 e9 65 fe ff ff e8 18 1e 04 0a 41 f7 c7 00 02 00 00 74 b3 fb 40 84 ed <75> b2 eb c3 90 0f 0b 90 e9 26 ff ff ff 90 0f 0b 90 e9 2e ff ff ff
RSP: 0018:ffffc900053479a0 EFLAGS: 00000202
RAX: 0000000000000046 RBX: 0000000000000001 RCX: 0000000000000046
RDX: ffffffff93fbc398 RSI: ffffffff8dfc731c RDI: ffffffff8c2886a0
RBP: ffff888036629f01 R08: ffffffff81aeb298 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff8e958780 R12: 0000000000000000
R13: ffff88806e3bf269 R14: 0000000000001000 R15: 0000000000000a87
qdisc_lock_uninit include/net/pkt_sched.h:332 [inline]
__qdisc_destroy+0x1ab/0x470 net/sched/sch_generic.c:1105
qdisc_put net/sched/sch_generic.c:1131 [inline]
dev_shutdown+0x352/0x450 net/sched/sch_generic.c:1496
unregister_netdevice_many_notify+0x11f0/0x2150 net/core/dev.c:12423
unregister_netdevice_many net/core/dev.c:12496 [inline]
unregister_netdevice_queue+0x2f5/0x340 net/core/dev.c:12308
unregister_netdevice include/linux/netdevice.h:3462 [inline]
__tun_detach+0x1018/0x1880 drivers/net/tun.c:628
tun_detach drivers/net/tun.c:644 [inline]
tun_chr_close+0x10a/0x1c0 drivers/net/tun.c:3506
__fput+0x418/0xa50 fs/file_table.c:510
task_work_run+0x1d9/0x270 kernel/task_work.c:233
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
__exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
exit_to_user_mode_loop+0x193/0x6b0 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
do_syscall_64+0x353/0x580 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f6db719ce59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff8bacd838 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007f6db7417da0 RCX: 00007f6db719ce59
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f6db7417da0 R08: 0000000000000006 R09: 0000000000000000
R10: 00007f6db7417cb0 R11: 0000000000000246 R12: 00000000000b64ee
R13: 00007f6db741627c R14: 00000000000b6430 R15: 00007f6db7416270
Allocated by task 17424:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5296 [inline]
__kmalloc_node_track_caller_noprof+0x4d7/0x7b0 mm/slub.c:5408
kmemdup_noprof+0x2b/0x70 mm/util.c:138
kmemdup_noprof include/linux/fortify-string.h:763 [inline]
fib_rules_register+0x2f/0x400 net/core/fib_rules.c:170
fib4_rules_init+0x21/0x160 net/ipv4/fib_rules.c:508
ip_fib_net_init net/ipv4/fib_frontend.c:1578 [inline]
fib_net_init+0x17a/0x3e0 net/ipv4/fib_frontend.c:1628
ops_init+0x35d/0x5d0 net/core/net_namespace.c:137
setup_net+0x118/0x350 net/core/net_namespace.c:446
copy_net_ns+0x4f9/0x720 net/core/net_namespace.c:579
create_new_namespaces+0x3f0/0x6b0 kernel/nsproxy.c:132
unshare_nsproxy_namespaces+0x149/0x190 kernel/nsproxy.c:234
ksys_unshare+0x57d/0xa00 kernel/fork.c:3242
__do_sys_unshare kernel/fork.c:3316 [inline]
__se_sys_unshare kernel/fork.c:3314 [inline]
__x64_sys_unshare+0x38/0x50 kernel/fork.c:3314
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 23:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2689 [inline]
__rcu_free_sheaf_prepare+0x12d/0x2a0 mm/slub.c:2940
rcu_free_sheaf+0x31/0x200 mm/slub.c:5850
rcu_do_batch kernel/rcu/tree.c:2617 [inline]
rcu_core+0x78b/0x10a0 kernel/rcu/tree.c:2869
handle_softirqs+0x225/0x840 kernel/softirq.c:622
run_ksoftirqd+0x36/0x60 kernel/softirq.c:1076
smpboot_thread_fn+0x57c/0xa80 kernel/smpboot.c:160
kthread+0x389/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
The buggy address belongs to the object at ffff888064abb700
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 128 bytes inside of
freed 192-byte region [ffff888064abb700, ffff888064abb7c0)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x64abb
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88813fe163c0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 15965, tgid 15965 (syz-executor), ts 377302284128, free_ts 371294725876
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x22d/0x280 mm/page_alloc.c:1853
prep_new_page mm/page_alloc.c:1861 [inline]
get_page_from_freelist+0x24ae/0x2530 mm/page_alloc.c:3941
__alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5221
alloc_slab_page mm/slub.c:3278 [inline]
allocate_slab+0x77/0x660 mm/slub.c:3467
new_slab mm/slub.c:3525 [inline]
refill_objects+0x336/0x3d0 mm/slub.c:7272
refill_sheaf mm/slub.c:2816 [inline]
__pcs_replace_empty_main+0x320/0x720 mm/slub.c:4652
alloc_from_pcs mm/slub.c:4750 [inline]
slab_alloc_node mm/slub.c:4884 [inline]
__do_kmalloc_node mm/slub.c:5295 [inline]
__kmalloc_noprof+0x464/0x750 mm/slub.c:5308
kmalloc_noprof include/linux/slab.h:954 [inline]
kzalloc_noprof include/linux/slab.h:1188 [inline]
new_dir fs/proc/proc_sysctl.c:966 [inline]
get_subdir fs/proc/proc_sysctl.c:1010 [inline]
sysctl_mkdir_p fs/proc/proc_sysctl.c:1320 [inline]
__register_sysctl_table+0xc02/0x1370 fs/proc/proc_sysctl.c:1395
neigh_sysctl_register+0x9b1/0xa90 net/core/neighbour.c:3915
devinet_sysctl_register+0xad/0x200 net/ipv4/devinet.c:2783
inetdev_init+0x29e/0x4d0 net/ipv4/devinet.c:291
inetdev_event+0x307/0x15e0 net/ipv4/devinet.c:1590
notifier_call_chain+0x1a5/0x3d0 kernel/notifier.c:85
call_netdevice_notifiers_extack net/core/dev.c:2288 [inline]
call_netdevice_notifiers net/core/dev.c:2302 [inline]
register_netdevice+0x18db/0x1f00 net/core/dev.c:11474
nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1070 [inline]
nsim_create+0xbd7/0x1140 drivers/net/netdevsim/netdev.c:1152
__nsim_dev_port_add+0x7f8/0xcd0 drivers/net/netdevsim/dev.c:1509
page last free pid 5637 tgid 5637 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1397 [inline]
__free_frozen_pages+0xc0d/0xd20 mm/page_alloc.c:2938
vfree+0x1fd/0x330 mm/vmalloc.c:3472
kcov_put kernel/kcov.c:444 [inline]
kcov_close+0x28/0x50 kernel/kcov.c:543
__fput+0x418/0xa50 fs/file_table.c:510
task_work_run+0x1d9/0x270 kernel/task_work.c:233
exit_task_work include/linux/task_work.h:40 [inline]
do_exit+0x73a/0x2360 kernel/exit.c:976
do_group_exit+0x22d/0x2f0 kernel/exit.c:1119
get_signal+0x121b/0x12c0 kernel/signal.c:3038
arch_do_signal_or_restart+0xbb/0x860 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:64 [inline]
exit_to_user_mode_loop+0xa9/0x6b0 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
do_syscall_64+0x353/0x580 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff888064abb680: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc
ffff888064abb700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888064abb780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff888064abb800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888064abb880: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 91 xchg %eax,%ecx
1: 03 09 add (%rcx),%ecx
3: 00 89 c6 48 c7 c7 add %cl,-0x3838b73a(%rcx)
9: 30 48 40 xor %cl,0x40(%rax)
c: 96 xchg %eax,%esi
d: e8 03 e8 06 0a call 0xa06e815
12: 90 nop
13: e9 65 fe ff ff jmp 0xfffffe7d
18: e8 18 1e 04 0a call 0xa041e35
1d: 41 f7 c7 00 02 00 00 test $0x200,%r15d
24: 74 b3 je 0xffffffd9
26: fb sti
27: 40 84 ed test %bpl,%bpl
* 2a: 75 b2 jne 0xffffffde <-- trapping instruction
2c: eb c3 jmp 0xfffffff1
2e: 90 nop
2f: 0f 0b ud2
31: 90 nop
32: e9 26 ff ff ff jmp 0xffffff5d
37: 90 nop
38: 0f 0b ud2
3a: 90 nop
3b: e9 2e ff ff ff jmp 0xffffff6e