==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x7a7/0x2ab0 net/ipv4/tcp_timer.c:535
Read of size 8 at addr ffff888164e93b40 by task syz-executor.2/6483
CPU: 0 PID: 6483 Comm: syz-executor.2 Not tainted 6.1.82-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
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_retransmit_timer+0x7a7/0x2ab0 net/ipv4/tcp_timer.c:535
tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:665
call_timer_fn+0x1ad/0x6b0 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+0x2e9/0xa4c 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:1106
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653
RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x60 kernel/kcov.c:203
Code: e8 25 00 00 00 0f 0b 0f 1f 00 53 48 89 fb e8 17 00 00 00 48 8b 3d 58 e1 e8 0c 48 89 de 5b e9 37 9e 56 00 cc cc cc cc cc cc cc <48> 8b 04 24 65 48 8b 0d a4 eb 77 7e 65 8b 15 a5 eb 77 7e f7 c2 00
RSP: 0018:ffffc90004b9f940 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffffffff91e8ee20 RCX: dffffc0000000000
RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffffffff91e8ee20
RBP: dffffc0000000000 R08: ffffffff83f27d39 R09: ffffffff83f28393
R10: 0000000000000003 R11: ffff888022cfd940 R12: ffffffff91e8ee20
R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000004
tomoyo_get_mode+0x16/0x1e0 security/tomoyo/util.c:994
tomoyo_path_permission+0xf9/0x360 security/tomoyo/file.c:579
tomoyo_path_perm+0x478/0x710 security/tomoyo/file.c:838
security_inode_getattr+0xcf/0x120 security/security.c:1361
vfs_getattr+0x26/0x360 fs/stat.c:158
vfs_statx+0x194/0x4b0 fs/stat.c:233
vfs_fstatat fs/stat.c:267 [inline]
__do_sys_newfstatat fs/stat.c:437 [inline]
__se_sys_newfstatat fs/stat.c:431 [inline]
__x64_sys_newfstatat+0x151/0x1e0 fs/stat.c:431
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fb0c847c84a
Code: 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 0b 00 00 00 66 2e 0f 1f 84 00 00 00 00 00 90 41 89 ca b8 06 01 00 00 0f 05 <3d> 00 f0 ff ff 77 07 31 c0 c3 0f 1f 40 00 48 c7 c2 b0 ff ff ff f7
RSP: 002b:00007ffcc182d0e8 EFLAGS: 00000286 ORIG_RAX: 0000000000000106
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb0c847c84a
RDX: 00007ffcc182d110 RSI: 00007ffcc182d1a0 RDI: 00000000ffffff9c
RBP: 00007ffcc182d1a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000100 R11: 0000000000000286 R12: 00007ffcc182e260
R13: 00007fb0c84c93b9 R14: 000000000003f9ad R15: 0000000000000003
Allocated by task 3589:
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+0x52/0x3a0 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+0x10c/0x2d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:682 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x580/0xb20 kernel/fork.c:3203
__do_sys_unshare kernel/fork.c:3274 [inline]
__se_sys_unshare kernel/fork.c:3272 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3272
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
The buggy address belongs to the object at ffff888164e93880
which belongs to the cache net_namespace of size 6976
The buggy address is located 704 bytes inside of
6976-byte region [ffff888164e93880, ffff888164e953c0)
The buggy address belongs to the physical page:
page:ffffea000593a400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888164e93880 pfn:0x164e90
head:ffffea000593a400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff00000010200 0000000000000000 dead000000000001 ffff888140009500
raw: ffff888164e93880 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 3580, tgid 3580 (syz-executor.1), ts 176059170154, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
prep_new_page mm/page_alloc.c:2520 [inline]
get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5545
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+0xc20/0x1270 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+0x1a5/0x2d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:682 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x580/0xb20 kernel/fork.c:3203
__do_sys_unshare kernel/fork.c:3274 [inline]
__se_sys_unshare kernel/fork.c:3272 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3272
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page_owner free stack trace missing
Memory state around the buggy address:
ffff888164e93a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888164e93a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888164e93b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888164e93b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888164e93c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: e8 25 00 00 00 call 0x2a
5: 0f 0b ud2
7: 0f 1f 00 nopl (%rax)
a: 53 push %rbx
b: 48 89 fb mov %rdi,%rbx
e: e8 17 00 00 00 call 0x2a
13: 48 8b 3d 58 e1 e8 0c mov 0xce8e158(%rip),%rdi # 0xce8e172
1a: 48 89 de mov %rbx,%rsi
1d: 5b pop %rbx
1e: e9 37 9e 56 00 jmp 0x569e5a
23: cc int3
24: cc int3
25: cc int3
26: cc int3
27: cc int3
28: cc int3
29: cc int3
* 2a: 48 8b 04 24 mov (%rsp),%rax <-- trapping instruction
2e: 65 48 8b 0d a4 eb 77 mov %gs:0x7e77eba4(%rip),%rcx # 0x7e77ebda
35: 7e
36: 65 8b 15 a5 eb 77 7e mov %gs:0x7e77eba5(%rip),%edx # 0x7e77ebe2
3d: f7 .byte 0xf7
3e: c2 .byte 0xc2