==================================================================
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:624
Read of size 1 at addr ffff88804927dc05 by task syz-executor.3/12696
CPU: 1 PID: 12696 Comm: syz-executor.3 Not tainted 6.1.15-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
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:378 [inline]
tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:624
tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:637
call_timer_fn+0x1e5/0x800 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+0x304/0xb09 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:1107
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:finish_lock_switch+0x91/0x100 kernel/sched/core.c:4998
Code: 45 31 c9 68 e7 67 60 81 e8 1c b5 09 00 48 83 c4 08 4c 89 ff e8 e0 cb fe ff 66 90 4c 89 ff e8 76 7d 2a 09 e8 a1 74 30 00 fb 5b <41> 5c 41 5d 41 5e 41 5f c3 44 89 f1 80 e1 07 80 c1 03 38 c1 7c 87
RSP: 0000:ffffc9000a3c7c98 EFLAGS: 00000286
RAX: 6851f8b72ac25c00 RBX: ffff8880558a1d74 RCX: ffffffff9196d003
RDX: dffffc0000000000 RSI: ffffffff8aebcf60 RDI: ffffffff8b3d0400
RBP: ffffc9000a3c7d10 R08: dffffc0000000000 R09: ffffed10173673b9
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 1ffff11017367563 R14: ffff8880b9b3ab18 R15: ffff8880b9b39dc0
finish_task_switch+0x134/0x630 kernel/sched/core.c:5115
context_switch kernel/sched/core.c:5241 [inline]
__schedule+0x137e/0x4360 kernel/sched/core.c:6551
schedule+0xbf/0x180 kernel/sched/core.c:6627
exit_to_user_mode_loop+0x44/0x100 kernel/entry/common.c:159
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203
irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:309
asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:654
RIP: 0033:0x7f40cfe393b6
Code: 1f 44 00 00 4c 89 ff e8 38 08 ff ff 41 08 c5 0f 85 f7 01 00 00 41 83 c6 01 44 39 73 04 0f 86 b7 00 00 00 48 8b 04 24 44 89 f7 <48> 8b 53 28 4d 89 f8 48 03 14 f8 80 3d f0 ec 16 00 00 49 89 d7 89
RSP: 002b:00007ffe386580d0 EFLAGS: 00000216
RAX: 00007f40cf400008 RBX: 00007f40cffac1b8 RCX: 0000001b30c20000
RDX: 0000000067cadaff RSI: 0000001b30c36c84 RDI: 00000000000232eb
RBP: 0000000067cadaff R08: 0000000000001aff R09: 0000000067cadb03
R10: 00007ffe38658290 R11: 0000000000000246 R12: 00007f40cffa0000
R13: 0000000000000001 R14: 00000000000232eb R15: ffffffff822ea777
Allocated by task 5297:
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+0x50/0x360 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+0x119/0x260 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:679 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x13d/0x5a0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x119/0x170 kernel/nsproxy.c:226
ksys_unshare+0x580/0xb20 kernel/fork.c:3193
__do_sys_unshare kernel/fork.c:3264 [inline]
__se_sys_unshare kernel/fork.c:3262 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3262
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486
insert_work+0x54/0x3d0 kernel/workqueue.c:1358
__queue_work+0xb59/0xfc0 kernel/workqueue.c:1517
call_timer_fn+0x1e5/0x800 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers+0x6a8/0x890 kernel/time/timer.c:1790
__do_softirq+0x304/0xb09 kernel/softirq.c:571
Second to last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486
insert_work+0x54/0x3d0 kernel/workqueue.c:1358
__queue_work+0xb59/0xfc0 kernel/workqueue.c:1517
queue_work_on+0x14b/0x250 kernel/workqueue.c:1545
xfrm_set_spdinfo+0x3fd/0x5d0 net/xfrm/xfrm_user.c:1385
xfrm_user_rcv_msg+0x6f0/0xa40 net/xfrm/xfrm_user.c:3054
netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2550
xfrm_netlink_rcv+0x70/0x80 net/xfrm/xfrm_user.c:3076
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x7bf/0x990 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x9fe/0xd10 net/netlink/af_netlink.c:1931
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg net/socket.c:734 [inline]
____sys_sendmsg+0x59e/0x8f0 net/socket.c:2485
___sys_sendmsg net/socket.c:2539 [inline]
__sys_sendmsg+0x2a9/0x390 net/socket.c:2568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
The buggy address belongs to the object at ffff88804927d4c0
which belongs to the cache net_namespace of size 6976
The buggy address is located 1861 bytes inside of
6976-byte region [ffff88804927d4c0, ffff88804927f000)
The buggy address belongs to the physical page:
page:ffffea0001249e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88804927d4c0 pfn:0x49278
head:ffffea0001249e00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88801fdd2601
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffff88801221a348 ffffea00009d6a08 ffff888140007500
raw: ffff88804927d4c0 0000000000040000 00000001ffffffff ffff88801fdd2601
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 4752, tgid 4750 (syz-executor.4), ts 155074780257, free_ts 155048764916
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x3542/0x36d0 mm/page_alloc.c:4291
__alloc_pages+0x28d/0x7e0 mm/page_alloc.c:5558
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+0xa71/0x1080 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+0x199/0x260 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:679 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x13d/0x5a0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
copy_namespaces+0x325/0x380 kernel/nsproxy.c:178
copy_process+0x1a66/0x3fd0 kernel/fork.c:2259
kernel_clone+0x222/0x9e0 kernel/fork.c:2676
__do_sys_clone kernel/fork.c:2817 [inline]
__se_sys_clone kernel/fork.c:2801 [inline]
__x64_sys_clone+0x231/0x280 kernel/fork.c:2801
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
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:1459 [inline]
free_pcp_prepare mm/page_alloc.c:1509 [inline]
free_unref_page_prepare+0xfdc/0x1190 mm/page_alloc.c:3387
free_unref_page+0x98/0x570 mm/page_alloc.c:3483
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+0x116/0x180 mm/slub.c:2662
qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x162/0x180 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+0x50/0x360 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+0x119/0x260 mm/slub.c:3422
getname_flags+0xb8/0x4e0 fs/namei.c:139
vfs_fstatat fs/stat.c:266 [inline]
__do_sys_newfstatat fs/stat.c:437 [inline]
__se_sys_newfstatat+0xe2/0x7b0 fs/stat.c:431
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Memory state around the buggy address:
ffff88804927db00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88804927db80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88804927dc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88804927dc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88804927dd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 45 31 c9 xor %r9d,%r9d
3: 68 e7 67 60 81 pushq $0xffffffff816067e7
8: e8 1c b5 09 00 callq 0x9b529
d: 48 83 c4 08 add $0x8,%rsp
11: 4c 89 ff mov %r15,%rdi
14: e8 e0 cb fe ff callq 0xfffecbf9
19: 66 90 xchg %ax,%ax
1b: 4c 89 ff mov %r15,%rdi
1e: e8 76 7d 2a 09 callq 0x92a7d99
23: e8 a1 74 30 00 callq 0x3074c9
28: fb sti
29: 5b pop %rbx
* 2a: 41 5c pop %r12 <-- trapping instruction
2c: 41 5d pop %r13
2e: 41 5e pop %r14
30: 41 5f pop %r15
32: c3 retq
33: 44 89 f1 mov %r14d,%ecx
36: 80 e1 07 and $0x7,%cl
39: 80 c1 03 add $0x3,%cl
3c: 38 c1 cmp %al,%cl
3e: 7c 87 jl 0xffffffc7