==================================================================
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 net/ipv4/tcp_timer.c:624 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x998/0x9f0 net/ipv4/tcp_timer.c:594
Read of size 1 at addr ffff88807cb12385 by task syz-executor.1/13815
CPU: 1 PID: 13815 Comm: syz-executor.1 Not tainted 6.0.0-rc6-syzkaller-01359-g9258b8b1be2e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:317 [inline]
print_report.cold+0x2ba/0x719 mm/kasan/report.c:433
kasan_report+0xb1/0x1e0 mm/kasan/report.c:495
tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline]
tcp_write_timer_handler net/ipv4/tcp_timer.c:624 [inline]
tcp_write_timer_handler+0x998/0x9f0 net/ipv4/tcp_timer.c:594
tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:637
call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers.part.0+0x674/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+0x1d3/0x9c6 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+0x16/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:pvclock_scale_delta arch/x86/include/asm/pvclock.h:68 [inline]
RIP: 0010:__pvclock_read_cycles arch/x86/include/asm/pvclock.h:85 [inline]
RIP: 0010:pvclock_clocksource_read+0x1a6/0x530 arch/x86/kernel/pvclock.c:76
Code: 84 ff 40 0f 95 c7 40 84 fe 0f 85 1a 03 00 00 85 d2 44 8b 5b 18 0f 88 54 01 00 00 80 f9 3f 0f 8f e2 f3 06 08 48 d3 e0 49 f7 e3 <48> 0f ac d0 20 4c 89 fa 4c 89 fe 4c 89 d1 48 c1 ea 03 83 e6 07 48
RSP: 0018:ffffc90008567980 EFLAGS: 00000a07
RAX: 6d20f825a6afc60f RBX: ffffffff8f518040 RCX: 0000000000000001
RDX: 00000000000000a0 RSI: 0000000000000001 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffffffff8f518058 R09: ffffffff8f51804f
R10: ffffffff8f518057 R11: 00000000e8b4406d R12: ffffffff8f518043
R13: fffffbfff1ea3009 R14: ffffffff8f51805d R15: ffffffff8f518050
kvm_clock_read arch/x86/kernel/kvmclock.c:79 [inline]
kvm_sched_clock_read+0x14/0x40 arch/x86/kernel/kvmclock.c:91
__bpf_prog_run include/linux/filter.h:584 [inline]
bpf_prog_run include/linux/filter.h:601 [inline]
bpf_test_run+0x568/0x9d0 net/bpf/test_run.c:402
bpf_prog_test_run_skb+0xbab/0x1e60 net/bpf/test_run.c:1146
bpf_prog_test_run kernel/bpf/syscall.c:3623 [inline]
__sys_bpf+0x18d7/0x5f80 kernel/bpf/syscall.c:4974
__do_sys_bpf kernel/bpf/syscall.c:5060 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5058 [inline]
__x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:5058
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+0x63/0xcd
RIP: 0033:0x7f50dc88a669
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f50ddab9168 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f50dc9abf80 RCX: 00007f50dc88a669
RDX: 0000000000000028 RSI: 0000000020000440 RDI: 000000000000000a
RBP: 00007f50dc8e5560 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff904405ef R14: 00007f50ddab9300 R15: 0000000000022000
Allocated by task 3641:
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:437 [inline]
__kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:470
kasan_slab_alloc include/linux/kasan.h:224 [inline]
slab_post_alloc_hook mm/slab.h:727 [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+0x267/0x3b0 mm/slub.c:3268
kmem_cache_zalloc include/linux/slab.h:723 [inline]
net_alloc net/core/net_namespace.c:404 [inline]
copy_net_ns+0x125/0x760 net/core/net_namespace.c:459
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:3181
__do_sys_unshare kernel/fork.c:3252 [inline]
__se_sys_unshare kernel/fork.c:3250 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3250
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+0x63/0xcd
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+0x625/0x1210 kernel/workqueue.c:1517
call_timer_fn+0x1a0/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+0x1d3/0x9c6 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+0x625/0x1210 kernel/workqueue.c:1517
call_timer_fn+0x1a0/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+0x1d3/0x9c6 kernel/softirq.c:571
The buggy address belongs to the object at ffff88807cb11c40
which belongs to the cache net_namespace of size 6976
The buggy address is located 1861 bytes inside of
6976-byte region [ffff88807cb11c40, ffff88807cb13780)
The buggy address belongs to the physical page:
page:ffffea0001f2c400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807cb11c40 pfn:0x7cb10
head:ffffea0001f2c400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001e12600 dead000000000002 ffff8881400073c0
raw: ffff88807cb11c40 0000000080040003 00000001ffffffff 0000000000000000
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 3637, tgid 3637 (syz-executor.5), ts 121034347428, free_ts 121030182553
prep_new_page mm/page_alloc.c:2532 [inline]
get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283
__alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515
alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270
alloc_slab_page mm/slub.c:1824 [inline]
allocate_slab+0x27e/0x3d0 mm/slub.c:1969
new_slab mm/slub.c:2029 [inline]
___slab_alloc+0x7f1/0xe10 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+0x38c/0x3b0 mm/slub.c:3268
kmem_cache_zalloc include/linux/slab.h:723 [inline]
net_alloc net/core/net_namespace.c:404 [inline]
copy_net_ns+0x125/0x760 net/core/net_namespace.c:459
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:3181
__do_sys_unshare kernel/fork.c:3252 [inline]
__se_sys_unshare kernel/fork.c:3250 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3250
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+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1449 [inline]
free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499
free_unref_page_prepare mm/page_alloc.c:3380 [inline]
free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476
__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:447
kasan_slab_alloc include/linux/kasan.h:224 [inline]
slab_post_alloc_hook mm/slab.h:727 [inline]
slab_alloc_node mm/slub.c:3243 [inline]
kmem_cache_alloc_node+0x2b1/0x3f0 mm/slub.c:3293
__alloc_skb+0x210/0x2f0 net/core/skbuff.c:422
alloc_skb include/linux/skbuff.h:1258 [inline]
netlink_alloc_large_skb net/netlink/af_netlink.c:1191 [inline]
netlink_sendmsg+0x9a2/0xe10 net/netlink/af_netlink.c:1896
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:734
__sys_sendto+0x236/0x340 net/socket.c:2117
__do_sys_sendto net/socket.c:2129 [inline]
__se_sys_sendto net/socket.c:2125 [inline]
__x64_sys_sendto+0xdd/0x1b0 net/socket.c:2125
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+0x63/0xcd
Memory state around the buggy address:
ffff88807cb12280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807cb12300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807cb12380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807cb12400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807cb12480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 84 ff test %bh,%bh
2: 40 0f 95 c7 setne %dil
6: 40 84 fe test %dil,%sil
9: 0f 85 1a 03 00 00 jne 0x329
f: 85 d2 test %edx,%edx
11: 44 8b 5b 18 mov 0x18(%rbx),%r11d
15: 0f 88 54 01 00 00 js 0x16f
1b: 80 f9 3f cmp $0x3f,%cl
1e: 0f 8f e2 f3 06 08 jg 0x806f406
24: 48 d3 e0 shl %cl,%rax
27: 49 f7 e3 mul %r11
* 2a: 48 0f ac d0 20 shrd $0x20,%rdx,%rax <-- trapping instruction
2f: 4c 89 fa mov %r15,%rdx
32: 4c 89 fe mov %r15,%rsi
35: 4c 89 d1 mov %r10,%rcx
38: 48 c1 ea 03 shr $0x3,%rdx
3c: 83 e6 07 and $0x7,%esi
3f: 48 rex.W