==================================================================
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652
Read of size 1 at addr ffff88801f702385 by task syz-executor.3/22921
CPU: 1 PID: 22921 Comm: syz-executor.3 Not tainted 6.1.82-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report+0x136/0x160 mm/kasan/report.c:495
tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline]
tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652
tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:665
call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers+0x67c/0x890 kernel/time/timer.c:1790
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653
RIP: 0010:check_kcov_mode kernel/kcov.c:184 [inline]
RIP: 0010:write_comp_data kernel/kcov.c:236 [inline]
RIP: 0010:__sanitizer_cov_trace_const_cmp4+0x30/0x80 kernel/kcov.c:304
Code: 8b 15 44 e8 77 7e 65 8b 05 45 e8 77 7e a9 00 01 ff 00 74 10 a9 00 01 00 00 74 5b 83 ba 1c 16 00 00 00 74 52 8b 82 f8 15 00 00 <83> f8 03 75 47 48 8b 8a 00 16 00 00 44 8b 8a fc 15 00 00 49 c1 e1
RSP: 0018:ffffc9000bd0f518 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000004 RCX: ffffffff81bd2775
RDX: ffff8880245a1dc0 RSI: 0000000000000004 RDI: 0000000000000000
RBP: ffffc9000bd0f6a0 R08: ffffffff81bd2794 R09: fffff940000c73ff
R10: 0000000000000000 R11: dffffc0000000001 R12: 0200000000000000
R13: 0000000000000000 R14: ffffea0000639fc0 R15: ffffea0000639ff4
put_page_testzero include/linux/mm.h:765 [inline]
folio_put_testzero include/linux/mm.h:771 [inline]
release_pages+0x334/0x2b40 mm/swap.c:1013
tlb_batch_pages_flush mm/mmu_gather.c:59 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:254 [inline]
tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261
zap_pte_range mm/memory.c:1525 [inline]
zap_pmd_range mm/memory.c:1574 [inline]
zap_pud_range mm/memory.c:1603 [inline]
zap_p4d_range mm/memory.c:1624 [inline]
unmap_page_range+0x217c/0x2740 mm/memory.c:1645
unmap_vmas+0x48b/0x640 mm/memory.c:1730
exit_mmap+0x252/0x9f0 mm/mmap.c:3227
__mmput+0x115/0x3c0 kernel/fork.c:1199
exit_mm+0x226/0x300 kernel/exit.c:563
do_exit+0x9f6/0x26a0 kernel/exit.c:856
do_group_exit+0x202/0x2b0 kernel/exit.c:1019
__do_sys_exit_group kernel/exit.c:1030 [inline]
__se_sys_exit_group kernel/exit.c:1028 [inline]
__x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fbc2c47dda9
Code: Unable to access opcode bytes at 0x7fbc2c47dd7f.
RSP: 002b:00007fff809021f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 000000000000001e RCX: 00007fbc2c47dda9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000001 R08: 0000000000000142 R09: 0000000000000000
R10: 0000001b2e820000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
Allocated by task 18275:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
__kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:682 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x580/0xb20 kernel/fork.c:3203
__do_sys_unshare kernel/fork.c:3274 [inline]
__se_sys_unshare kernel/fork.c:3272 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3272
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Freed by task 10023:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
kmem_cache_free+0x292/0x510 mm/slub.c:3683
net_free net/core/net_namespace.c:439 [inline]
cleanup_net+0xab5/0xb60 net/core/net_namespace.c:622
process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:307
The buggy address belongs to the object at ffff88801f701c40
which belongs to the cache net_namespace of size 6976
The buggy address is located 1861 bytes inside of
6976-byte region [ffff88801f701c40, ffff88801f703780)
The buggy address belongs to the physical page:
page:ffffea00007dc000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f700
head:ffffea00007dc000 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888024747c81
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888140009500
raw: 0000000000000000 0000000080040004 00000001ffffffff ffff888024747c81
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3663, tgid 3661 (syz-executor.3), ts 200458881000, free_ts 200114550117
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
prep_new_page mm/page_alloc.c:2520 [inline]
get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5545
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xc20/0x1270 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x1a5/0x2d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:682 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
copy_namespaces+0x397/0x3f0 kernel/nsproxy.c:178
copy_process+0x1ab8/0x4060 kernel/fork.c:2270
kernel_clone+0x222/0x920 kernel/fork.c:2682
__do_sys_clone kernel/fork.c:2823 [inline]
__se_sys_clone kernel/fork.c:2807 [inline]
__x64_sys_clone+0x231/0x280 kernel/fork.c:2807
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1440 [inline]
free_pcp_prepare mm/page_alloc.c:1490 [inline]
free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358
free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453
free_slab mm/slub.c:2031 [inline]
discard_slab mm/slub.c:2037 [inline]
__unfreeze_partials+0x1b7/0x210 mm/slub.c:2586
put_cpu_partial+0x17b/0x250 mm/slub.c:2662
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
__kmem_cache_alloc_node+0x137/0x260 mm/slub.c:3437
kmalloc_trace+0x26/0xe0 mm/slab_common.c:1045
kmalloc include/linux/slab.h:556 [inline]
kzalloc include/linux/slab.h:692 [inline]
nsim_fib6_rt_create drivers/net/netdevsim/fib.c:547 [inline]
nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:752 [inline]
nsim_fib6_event drivers/net/netdevsim/fib.c:856 [inline]
nsim_fib_event drivers/net/netdevsim/fib.c:889 [inline]
nsim_fib_event_work+0x19be/0x4120 drivers/net/netdevsim/fib.c:1492
process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
process_scheduled_works kernel/workqueue.c:2355 [inline]
worker_thread+0xd04/0x1200 kernel/workqueue.c:2441
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:307
Memory state around the buggy address:
ffff88801f702280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801f702300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801f702380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801f702400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801f702480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 8b 15 44 e8 77 7e mov 0x7e77e844(%rip),%edx # 0x7e77e84a
6: 65 8b 05 45 e8 77 7e mov %gs:0x7e77e845(%rip),%eax # 0x7e77e852
d: a9 00 01 ff 00 test $0xff0100,%eax
12: 74 10 je 0x24
14: a9 00 01 00 00 test $0x100,%eax
19: 74 5b je 0x76
1b: 83 ba 1c 16 00 00 00 cmpl $0x0,0x161c(%rdx)
22: 74 52 je 0x76
24: 8b 82 f8 15 00 00 mov 0x15f8(%rdx),%eax
* 2a: 83 f8 03 cmp $0x3,%eax <-- trapping instruction
2d: 75 47 jne 0x76
2f: 48 8b 8a 00 16 00 00 mov 0x1600(%rdx),%rcx
36: 44 8b 8a fc 15 00 00 mov 0x15fc(%rdx),%r9d
3d: 49 rex.WB
3e: c1 .byte 0xc1
3f: e1 .byte 0xe1