==================================================================
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+0x7e2/0x920 net/ipv4/tcp_timer.c:624
Read of size 1 at addr ffff88807d6ba385 by task syz-executor.2/3638
CPU: 0 PID: 3638 Comm: syz-executor.2 Not tainted 6.0.0-syzkaller-09589-g55be6084c8e0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description+0x65/0x4b0 mm/kasan/report.c:317
print_report+0x108/0x220 mm/kasan/report.c:433
kasan_report+0xfb/0x130 mm/kasan/report.c:495
tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline]
tcp_write_timer_handler+0x7e2/0x920 net/ipv4/tcp_timer.c:624
tcp_write_timer+0x176/0x280 net/ipv4/tcp_timer.c:637
call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers+0x76a/0x980 kernel/time/timer.c:1790
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803
__do_softirq+0x277/0x75b kernel/softirq.c:571
__irq_exit_rcu+0xec/0x170 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:check_kcov_mode kernel/kcov.c:166 [inline]
RIP: 0010:write_comp_data kernel/kcov.c:229 [inline]
RIP: 0010:__sanitizer_cov_trace_const_cmp8+0x14/0xa0 kernel/kcov.c:304
Code: 48 83 c8 10 48 89 14 01 48 83 ce 18 4c 89 0c 31 4c 89 44 f9 20 c3 4c 8b 04 24 65 48 8b 14 25 00 6f 02 00 65 8b 0d e4 fd 79 7e c1 00 01 ff 00 74 11 f7 c1 00 01 00 00 74 76 83 ba bc 15 00 00
RSP: 0018:ffffc90004397e98 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000037 RCX: 0000000080000000
RDX: ffff888026e99d80 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000040000000 R08: ffffffff882e510f R09: ffffed1004f05e91
R10: ffffed1004f05e91 R11: 1ffff11004f05e90 R12: 0000000000000000
R13: 0000000000000000 R14: ffff88802b54c200 R15: ffff888026e99d80
in_x32_syscall arch/x86/include/asm/compat.h:86 [inline]
in_32bit_syscall arch/x86/include/asm/compat.h:94 [inline]
in_compat_syscall arch/x86/include/asm/compat.h:100 [inline]
__sys_getsockopt+0x1df/0x5d0 net/socket.c:2288
__do_sys_getsockopt net/socket.c:2311 [inline]
__se_sys_getsockopt net/socket.c:2308 [inline]
__x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2308
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f178d88cbca
Code: 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 37 00 00 00 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:00007ffeb61b1388 EFLAGS: 00000246 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 00007f178d97f1c0 RCX: 00007f178d88cbca
RDX: 0000000000000080 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007ffeb61b13ac R09: ffffffffffff0000
R10: 00007ffeb61b13b0 R11: 0000000000000246 R12: 0000000000000003
R13: 00007ffeb61b13b0 R14: 0000000000000003 R15: 00007ffeb61b13ac
Allocated by task 19057:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:437 [inline]
__kasan_slab_alloc+0xb2/0xe0 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:3248 [inline]
slab_alloc mm/slub.c:3256 [inline]
__kmem_cache_alloc_lru mm/slub.c:3263 [inline]
kmem_cache_alloc+0x1a6/0x310 mm/slub.c:3273
kmem_cache_zalloc include/linux/slab.h:723 [inline]
net_alloc net/core/net_namespace.c:403 [inline]
copy_net_ns+0x13c/0x5b0 net/core/net_namespace.c:458
create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110
copy_namespaces+0x333/0x390 kernel/nsproxy.c:178
copy_process+0x1a55/0x3fc0 kernel/fork.c:2257
kernel_clone+0x227/0x640 kernel/fork.c:2672
__do_sys_clone kernel/fork.c:2806 [inline]
__se_sys_clone kernel/fork.c:2790 [inline]
__x64_sys_clone+0x276/0x2e0 kernel/fork.c:2790
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 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:38
__kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348
insert_work+0x54/0x3e0 kernel/workqueue.c:1358
__queue_work+0xa31/0xce0 kernel/workqueue.c:1517
call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers+0x7a2/0x980 kernel/time/timer.c:1790
__do_softirq+0x277/0x75b kernel/softirq.c:571
Second to last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348
insert_work+0x54/0x3e0 kernel/workqueue.c:1358
__queue_work+0xa31/0xce0 kernel/workqueue.c:1517
call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers+0x7a2/0x980 kernel/time/timer.c:1790
__do_softirq+0x277/0x75b kernel/softirq.c:571
The buggy address belongs to the object at ffff88807d6b9c40
which belongs to the cache net_namespace of size 6976
The buggy address is located 1861 bytes inside of
6976-byte region [ffff88807d6b9c40, ffff88807d6bb780)
The buggy address belongs to the physical page:
page:ffffea0001f5ae00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807d6b8000 pfn:0x7d6b8
head:ffffea0001f5ae00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88807b68a3c1
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0000e85600 dead000000000002 ffff8880121db500
raw: ffff88807d6b8000 0000000080040002 00000001ffffffff ffff88807b68a3c1
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 3639, tgid 3639 (syz-executor.4), ts 135391063034, free_ts 135388312949
prep_new_page mm/page_alloc.c:2532 [inline]
get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283
__alloc_pages+0x259/0x560 mm/page_alloc.c:5549
alloc_slab_page+0x70/0xf0 mm/slub.c:1829
allocate_slab+0x5e/0x520 mm/slub.c:1974
new_slab mm/slub.c:2034 [inline]
___slab_alloc+0x42e/0xce0 mm/slub.c:3036
__slab_alloc mm/slub.c:3123 [inline]
slab_alloc_node mm/slub.c:3214 [inline]
slab_alloc mm/slub.c:3256 [inline]
__kmem_cache_alloc_lru mm/slub.c:3263 [inline]
kmem_cache_alloc+0x25d/0x310 mm/slub.c:3273
kmem_cache_zalloc include/linux/slab.h:723 [inline]
net_alloc net/core/net_namespace.c:403 [inline]
copy_net_ns+0x13c/0x5b0 net/core/net_namespace.c:458
create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x180 kernel/nsproxy.c:226
ksys_unshare+0x57f/0xb30 kernel/fork.c:3182
__do_sys_unshare kernel/fork.c:3253 [inline]
__se_sys_unshare kernel/fork.c:3251 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3251
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 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+0x812/0x900 mm/page_alloc.c:1499
free_unref_page_prepare mm/page_alloc.c:3380 [inline]
free_unref_page+0x7d/0x630 mm/page_alloc.c:3476
free_slab mm/slub.c:2073 [inline]
discard_slab mm/slub.c:2079 [inline]
__unfreeze_partials+0x1ab/0x200 mm/slub.c:2553
put_cpu_partial+0x116/0x180 mm/slub.c:2629
qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x2f/0xe0 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:3248 [inline]
__kmalloc_node+0x1f9/0x420 mm/slub.c:4473
kmalloc_node include/linux/slab.h:623 [inline]
kzalloc_node include/linux/slab.h:744 [inline]
qdisc_alloc+0x8e/0xa00 net/sched/sch_generic.c:938
qdisc_create_dflt+0x6c/0x2a0 net/sched/sch_generic.c:996
attach_one_default_qdisc net/sched/sch_generic.c:1151 [inline]
netdev_for_each_tx_queue include/linux/netdevice.h:2440 [inline]
attach_default_qdiscs net/sched/sch_generic.c:1169 [inline]
dev_activate+0x353/0x1250 net/sched/sch_generic.c:1228
__dev_open+0x3f1/0x510 net/core/dev.c:1441
__dev_change_flags+0x1e0/0x6d0 net/core/dev.c:8539
dev_change_flags+0x85/0x190 net/core/dev.c:8610
do_setlink+0xf36/0x3f10 net/core/rtnetlink.c:2788
__rtnl_newlink net/core/rtnetlink.c:3547 [inline]
rtnl_newlink+0x183e/0x2060 net/core/rtnetlink.c:3594
Memory state around the buggy address:
ffff88807d6ba280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807d6ba300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807d6ba380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807d6ba400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807d6ba480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 48 83 c8 10 or $0x10,%rax
4: 48 89 14 01 mov %rdx,(%rcx,%rax,1)
8: 48 83 ce 18 or $0x18,%rsi
c: 4c 89 0c 31 mov %r9,(%rcx,%rsi,1)
10: 4c 89 44 f9 20 mov %r8,0x20(%rcx,%rdi,8)
15: c3 retq
16: 4c 8b 04 24 mov (%rsp),%r8
1a: 65 48 8b 14 25 00 6f mov %gs:0x26f00,%rdx
21: 02 00
23: 65 8b 0d e4 fd 79 7e mov %gs:0x7e79fde4(%rip),%ecx # 0x7e79fe0e
* 2a: f7 c1 00 01 ff 00 test $0xff0100,%ecx <-- trapping instruction
30: 74 11 je 0x43
32: f7 c1 00 01 00 00 test $0x100,%ecx
38: 74 76 je 0xb0
3a: 83 .byte 0x83
3b: ba bc 15 00 00 mov $0x15bc,%edx