==================================================================
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:377 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler net/ipv4/tcp_timer.c:620 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x998/0x9f0 net/ipv4/tcp_timer.c:590
Read of size 1 at addr ffff888073043da5 by task kworker/u4:0/29458
CPU: 0 PID: 29458 Comm: kworker/u4:0 Not tainted 5.19.0-rc4-syzkaller-00843-g7e40e16e38ba #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022
Workqueue: bat_events batadv_tt_purge
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313
print_report mm/kasan/report.c:429 [inline]
kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491
tcp_probe_timer net/ipv4/tcp_timer.c:377 [inline]
tcp_write_timer_handler net/ipv4/tcp_timer.c:620 [inline]
tcp_write_timer_handler+0x998/0x9f0 net/ipv4/tcp_timer.c:590
tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:633
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers.part.0+0x679/0xa80 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803
__do_softirq+0x29b/0x9c2 kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:__local_bh_enable_ip+0xa8/0x120 kernel/softirq.c:403
Code: 1d fd 20 ba 7e 65 8b 05 f6 20 ba 7e a9 00 ff ff 00 74 45 bf 01 00 00 00 e8 55 90 09 00 e8 20 6b 38 00 fb 65 8b 05 d8 20 ba 7e <85> c0 74 58 5b 5d c3 65 8b 05 c6 27 ba 7e 85 c0 75 a2 0f 0b eb 9e
RSP: 0018:ffffc9001b377c00 EFLAGS: 00000206
RAX: 0000000080000000 RBX: 00000000fffffe00 RCX: 1ffffffff20daf96
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffffff8913b025 R08: 0000000000000001 R09: ffffffff9067a9f7
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000100
R13: ffff88805903e418 R14: 0000000000000238 R15: dffffc0000000000
spin_unlock_bh include/linux/spinlock.h:394 [inline]
batadv_tt_local_purge+0x285/0x370 net/batman-adv/translation-table.c:1357
batadv_tt_purge+0x2c/0xaf0 net/batman-adv/translation-table.c:3561
process_one_work+0x996/0x1610 kernel/workqueue.c:2289
worker_thread+0x665/0x1080 kernel/workqueue.c:2436
kthread+0x2e9/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
Allocated by task 3636:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:436 [inline]
__kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469
kasan_slab_alloc include/linux/kasan.h:224 [inline]
slab_post_alloc_hook mm/slab.h:750 [inline]
slab_alloc_node mm/slub.c:3243 [inline]
slab_alloc mm/slub.c:3251 [inline]
__kmem_cache_alloc_lru mm/slub.c:3258 [inline]
kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3268
kmem_cache_zalloc include/linux/slab.h:723 [inline]
net_alloc net/core/net_namespace.c:403 [inline]
copy_net_ns+0x125/0x760 net/core/net_namespace.c:458
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x445/0x920 kernel/fork.c:3165
__do_sys_unshare kernel/fork.c:3236 [inline]
__se_sys_unshare kernel/fork.c:3234 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3234
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
Last potentially related work creation:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
__kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348
insert_work+0x48/0x350 kernel/workqueue.c:1358
__queue_work+0x62f/0x1150 kernel/workqueue.c:1517
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1805
__do_softirq+0x29b/0x9c2 kernel/softirq.c:571
Second to last potentially related work creation:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
__kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348
insert_work+0x48/0x350 kernel/workqueue.c:1358
__queue_work+0x62f/0x1150 kernel/workqueue.c:1517
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1805
__do_softirq+0x29b/0x9c2 kernel/softirq.c:571
The buggy address belongs to the object at ffff888073043700
which belongs to the cache net_namespace of size 6784
The buggy address is located 1701 bytes inside of
6784-byte region [ffff888073043700, ffff888073045180)
The buggy address belongs to the physical page:
page:ffffea0001cc1000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888073043700 pfn:0x73040
head:ffffea0001cc1000 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88801d5d1a41
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001b77000 dead000000000003 ffff8881400073c0
raw: ffff888073043700 0000000080040002 00000001ffffffff ffff88801d5d1a41
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3634, tgid 3634 (syz-executor.0), ts 130055788553, free_ts 91516097399
prep_new_page mm/page_alloc.c:2456 [inline]
get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198
__alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426
alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272
alloc_slab_page mm/slub.c:1824 [inline]
allocate_slab+0x26c/0x3c0 mm/slub.c:1969
new_slab mm/slub.c:2029 [inline]
___slab_alloc+0x9c4/0xe20 mm/slub.c:3031
__slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118
slab_alloc_node mm/slub.c:3209 [inline]
slab_alloc mm/slub.c:3251 [inline]
__kmem_cache_alloc_lru mm/slub.c:3258 [inline]
kmem_cache_alloc+0x360/0x3b0 mm/slub.c:3268
kmem_cache_zalloc include/linux/slab.h:723 [inline]
net_alloc net/core/net_namespace.c:403 [inline]
copy_net_ns+0x125/0x760 net/core/net_namespace.c:458
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x445/0x920 kernel/fork.c:3165
__do_sys_unshare kernel/fork.c:3236 [inline]
__se_sys_unshare kernel/fork.c:3234 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3234
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1371 [inline]
free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421
free_unref_page_prepare mm/page_alloc.c:3343 [inline]
free_unref_page+0x19/0x6a0 mm/page_alloc.c:3438
__unfreeze_partials+0x17c/0x1a0 mm/slub.c:2548
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446
kasan_slab_alloc include/linux/kasan.h:224 [inline]
slab_post_alloc_hook mm/slab.h:750 [inline]
slab_alloc_node mm/slub.c:3243 [inline]
kmem_cache_alloc_node+0x255/0x3f0 mm/slub.c:3293
__alloc_skb+0x215/0x340 net/core/skbuff.c:418
alloc_skb_fclone include/linux/skbuff.h:1299 [inline]
tcp_stream_alloc_skb+0x38/0x580 net/ipv4/tcp.c:861
tcp_sendmsg_locked+0xad1/0x2e90 net/ipv4/tcp.c:1318
tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1473
inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:734
sock_write_iter+0x284/0x3c0 net/socket.c:1108
call_write_iter include/linux/fs.h:2058 [inline]
new_sync_write+0x38a/0x560 fs/read_write.c:504
vfs_write+0x7c0/0xac0 fs/read_write.c:591
Memory state around the buggy address:
ffff888073043c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888073043d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888073043d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888073043e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888073043e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 1d fd 20 ba 7e sbb $0x7eba20fd,%eax
5: 65 8b 05 f6 20 ba 7e mov %gs:0x7eba20f6(%rip),%eax # 0x7eba2102
c: a9 00 ff ff 00 test $0xffff00,%eax
11: 74 45 je 0x58
13: bf 01 00 00 00 mov $0x1,%edi
18: e8 55 90 09 00 callq 0x99072
1d: e8 20 6b 38 00 callq 0x386b42
22: fb sti
23: 65 8b 05 d8 20 ba 7e mov %gs:0x7eba20d8(%rip),%eax # 0x7eba2102
* 2a: 85 c0 test %eax,%eax <-- trapping instruction
2c: 74 58 je 0x86
2e: 5b pop %rbx
2f: 5d pop %rbp
30: c3 retq
31: 65 8b 05 c6 27 ba 7e mov %gs:0x7eba27c6(%rip),%eax # 0x7eba27fe
38: 85 c0 test %eax,%eax
3a: 75 a2 jne 0xffffffde
3c: 0f 0b ud2
3e: eb 9e jmp 0xffffffde