==================================================================
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+0x99c/0x9f0 net/ipv4/tcp_timer.c:594
Read of size 1 at addr ffff888076caa385 by task kworker/0:20/4266
CPU: 0 PID: 4266 Comm: kworker/0:20 Not tainted 6.1.0-rc7-syzkaller-00143-ge8b4fc13900b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Workqueue: rcu_gp process_srcu
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15e/0x45d mm/kasan/report.c:395
kasan_report+0xbf/0x1f0 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+0x99c/0x9f0 net/ipv4/tcp_timer.c:594
tcp_write_timer+0xa6/0x2b0 net/ipv4/tcp_timer.c:637
call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers.part.0+0x6a2/0xaf0 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0xb7/0x1d0 kernel/time/timer.c:1803
__do_softirq+0x1fb/0xadc kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
irq_exit_rcu+0x9/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1107
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:rdtsc_ordered arch/x86/include/asm/msr.h:215 [inline]
RIP: 0010:delay_tsc+0x49/0xb0 arch/x86/lib/delay.c:72
Code: 0f 01 f9 66 90 48 c1 e2 20 48 09 c2 48 89 d5 eb 16 f3 90 bf 01 00 00 00 e8 f4 26 b1 f7 e8 cf 5e 48 00 44 39 e0 75 36 0f 01 f9 <66> 90 48 c1 e2 20 48 89 d3 48 09 c3 48 89 d8 48 29 e8 4c 39 e8 73
RSP: 0018:ffffc90014f8fbb8 EFLAGS: 00000246
RAX: 000000004cd44f52 RBX: 0000008a4cd44eda RCX: 0000000000000000
RDX: 000000000000008a RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000008a4cd443a0 R08: 0000000000000006 R09: 0000000000000002
R10: 0000000000000002 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000002af9 R14: 000000000000ae2f R15: 000000000000ae30
try_check_zero+0x20f/0x470 kernel/rcu/srcutree.c:974
srcu_advance_state kernel/rcu/srcutree.c:1521 [inline]
process_srcu+0x38b/0x11b0 kernel/rcu/srcutree.c:1622
process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289
worker_thread+0x669/0x1090 kernel/workqueue.c:2436
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
Allocated by task 3654:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x82/0x90 mm/kasan/common.c:325
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slab.h:737 [inline]
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+0x2b4/0x3d0 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+0x129/0x760 net/core/net_namespace.c:465
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x449/0x920 kernel/fork.c:3188
__do_sys_unshare kernel/fork.c:3259 [inline]
__se_sys_unshare kernel/fork.c:3257 [inline]
__x64_sys_unshare+0x31/0x40 kernel/fork.c:3257
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Last potentially related work creation:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481
insert_work+0x48/0x350 kernel/workqueue.c:1358
__queue_work+0x693/0x13b0 kernel/workqueue.c:1517
call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0x156/0x1d0 kernel/time/timer.c:1805
__do_softirq+0x1fb/0xadc kernel/softirq.c:571
The buggy address belongs to the object at ffff888076ca9c40
which belongs to the cache net_namespace of size 6976
The buggy address is located 1861 bytes inside of
6976-byte region [ffff888076ca9c40, ffff888076cab780)
The buggy address belongs to the physical page:
page:ffffea0001db2a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888076ca9c40 pfn:0x76ca8
head:ffffea0001db2a00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888020f4c541
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0000794c08 ffffea0001e75608 ffff8880121e1500
raw: ffff888076ca9c40 0000000000040001 00000001ffffffff ffff888020f4c541
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 3646, tgid 3646 (syz-executor.0), ts 68532448108, free_ts 68531770534
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291
__alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558
alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285
alloc_slab_page mm/slub.c:1794 [inline]
allocate_slab+0x213/0x300 mm/slub.c:1939
new_slab mm/slub.c:1992 [inline]
___slab_alloc+0xa91/0x1400 mm/slub.c:3180
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279
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+0x31a/0x3d0 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+0x129/0x760 net/core/net_namespace.c:465
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x449/0x920 kernel/fork.c:3188
__do_sys_unshare kernel/fork.c:3259 [inline]
__se_sys_unshare kernel/fork.c:3257 [inline]
__x64_sys_unshare+0x31/0x40 kernel/fork.c:3257
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/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+0x65c/0xd90 mm/page_alloc.c:1509
free_unref_page_prepare mm/page_alloc.c:3387 [inline]
free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483
__unfreeze_partials+0x17c/0x1a0 mm/slub.c:2586
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x184/0x210 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slab.h:737 [inline]
slab_alloc_node mm/slub.c:3398 [inline]
__kmem_cache_alloc_node+0x2e2/0x3e0 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc+0x4a/0xd0 mm/slab_common.c:968
kmalloc include/linux/slab.h:558 [inline]
tomoyo_add_entry security/tomoyo/common.c:2022 [inline]
tomoyo_supervisor+0xcfc/0xf10 security/tomoyo/common.c:2094
tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline]
tomoyo_path_number_perm+0x3f3/0x550 security/tomoyo/file.c:734
security_file_ioctl+0x54/0xb0 security/security.c:1554
__do_sys_ioctl fs/ioctl.c:864 [inline]
__se_sys_ioctl fs/ioctl.c:856 [inline]
__x64_sys_ioctl+0xb7/0x210 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Memory state around the buggy address:
ffff888076caa280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888076caa300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888076caa380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888076caa400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888076caa480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 0f 01 f9 rdtscp
3: 66 90 xchg %ax,%ax
5: 48 c1 e2 20 shl $0x20,%rdx
9: 48 09 c2 or %rax,%rdx
c: 48 89 d5 mov %rdx,%rbp
f: eb 16 jmp 0x27
11: f3 90 pause
13: bf 01 00 00 00 mov $0x1,%edi
18: e8 f4 26 b1 f7 callq 0xf7b12711
1d: e8 cf 5e 48 00 callq 0x485ef1
22: 44 39 e0 cmp %r12d,%eax
25: 75 36 jne 0x5d
27: 0f 01 f9 rdtscp
* 2a: 66 90 xchg %ax,%ax <-- trapping instruction
2c: 48 c1 e2 20 shl $0x20,%rdx
30: 48 89 d3 mov %rdx,%rbx
33: 48 09 c3 or %rax,%rbx
36: 48 89 d8 mov %rbx,%rax
39: 48 29 e8 sub %rbp,%rax
3c: 4c 39 e8 cmp %r13,%rax
3f: 73 .byte 0x73