==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x6ee/0x2890 net/ipv4/tcp_timer.c:515
Read of size 8 at addr ffff88807ed79c98 by task udevd/2959
CPU: 1 PID: 2959 Comm: udevd Not tainted 5.15.107-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
tcp_retransmit_timer+0x6ee/0x2890 net/ipv4/tcp_timer.c:515
tcp_write_timer_handler+0x1f7/0x9c0 net/ipv4/tcp_timer.c:626
tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:646
call_timer_fn+0x16d/0x560 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers+0x67c/0x890 kernel/time/timer.c:1737
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1750
__do_softirq+0x3b3/0x93a kernel/softirq.c:558
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:636
irq_exit_rcu+0x5/0x20 kernel/softirq.c:648
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1097
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638
RIP: 0010:kasan_quarantine_put+0x84/0x220 mm/kasan/quarantine.c:234
Code: e8 f1 10 bd ff 48 c7 04 24 00 00 00 00 9c 8f 04 24 f7 04 24 00 02 00 00 0f 85 83 00 00 00 41 f7 c7 00 02 00 00 74 01 fb 31 c0 <48> 83 c4 08 5b 41 5c 41 5d 41 5e 41 5f c3 48 8d 80 00 56 03 00 45
RSP: 0018:ffffc90002caf488 EFLAGS: 00000206
RAX: 39db66e938a80601 RBX: ffff88807502e000 RCX: ffffffff913aef03
RDX: dffffc0000000000 RSI: ffffffff8a8af0e0 RDI: ffffffff8ad85240
RBP: ffffc90002caf520 R08: ffffffff81862a70 R09: fffffbfff1bc6396
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90002caf518
R13: ffff888011c42140 R14: 000000000002cb50 R15: 0000000000000286
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0xf1/0x270 mm/slub.c:4559
tomoyo_realpath_from_path+0x5ad/0x5e0 security/tomoyo/realpath.c:291
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x22c/0x490 security/tomoyo/file.c:771
security_file_open+0x5f/0xa0 security/security.c:1650
do_dentry_open+0x315/0xfb0 fs/open.c:813
do_open fs/namei.c:3538 [inline]
path_openat+0x2702/0x2f20 fs/namei.c:3672
do_filp_open+0x21c/0x460 fs/namei.c:3699
do_sys_openat2+0x13b/0x500 fs/open.c:1211
do_sys_open fs/open.c:1227 [inline]
__do_sys_openat fs/open.c:1243 [inline]
__se_sys_openat fs/open.c:1238 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1238
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+0x61/0xcb
RIP: 0033:0x7fa0475c95a4
Code: f9 41 89 f0 41 83 e2 40 75 2c 89 f0 25 00 00 41 00 3d 00 00 41 00 74 1e 44 89 c2 4c 89 ce bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 2c c3 0f 1f 00 48 8d 44 24 08 c7 44 24 b8 10
RSP: 002b:00007ffe9219e928 EFLAGS: 00000287 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000561085157750 RCX: 00007fa0475c95a4
RDX: 0000000000090800 RSI: 0000561085159140 RDI: 00000000ffffff9c
RBP: 000056108517f720 R08: 0000000000090800 R09: 0000561085159140
R10: 0000000000000000 R11: 0000000000000287 R12: 0000561085159140
R13: 00000000000000fd R14: 00007ffe9219e980 R15: 0000000000000000
Allocated by task 3611:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
kmem_cache_zalloc include/linux/slab.h:711 [inline]
net_alloc net/core/net_namespace.c:405 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:460
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:3094
__do_sys_unshare kernel/fork.c:3168 [inline]
__se_sys_unshare kernel/fork.c:3166 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3166
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+0x61/0xcb
The buggy address belongs to the object at ffff88807ed79a40
which belongs to the cache net_namespace of size 6464
The buggy address is located 600 bytes inside of
6464-byte region [ffff88807ed79a40, ffff88807ed7b380)
The buggy address belongs to the page:
page:ffffea0001fb5e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7ed78
head:ffffea0001fb5e00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff8880796b4a81
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001d94200 0000000200000002 ffff888011dc63c0
raw: 0000000000000000 0000000080040004 00000001ffffffff ffff8880796b4a81
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 3602, ts 50022238524, free_ts 49983409859
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
__alloc_pages+0x272/0x700 mm/page_alloc.c:5421
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc+0x18e/0x280 mm/slub.c:3233
kmem_cache_zalloc include/linux/slab.h:711 [inline]
net_alloc net/core/net_namespace.c:405 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:460
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:3094
__do_sys_unshare kernel/fork.c:3168 [inline]
__se_sys_unshare kernel/fork.c:3166 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3166
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+0x61/0xcb
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
free_slab mm/slub.c:2015 [inline]
discard_slab mm/slub.c:2021 [inline]
__unfreeze_partials+0x1b7/0x210 mm/slub.c:2507
put_cpu_partial+0x132/0x1a0 mm/slub.c:2587
do_slab_free mm/slub.c:3487 [inline]
___cache_free+0xe3/0x100 mm/slub.c:3506
qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc_trace+0xfb/0x290 mm/slub.c:3245
kmalloc include/linux/slab.h:591 [inline]
tomoyo_print_header security/tomoyo/audit.c:156 [inline]
tomoyo_init_log+0x1bf/0x1fe0 security/tomoyo/audit.c:255
tomoyo_supervisor+0x3b8/0x12c0 security/tomoyo/common.c:2097
tomoyo_audit_path_log security/tomoyo/file.c:168 [inline]
tomoyo_path_permission+0x243/0x360 security/tomoyo/file.c:587
tomoyo_check_open_permission+0x350/0x490 security/tomoyo/file.c:780
security_file_open+0x5f/0xa0 security/security.c:1650
do_dentry_open+0x315/0xfb0 fs/open.c:813
Memory state around the buggy address:
ffff88807ed79b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807ed79c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807ed79c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807ed79d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807ed79d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: e8 f1 10 bd ff callq 0xffbd10f6
5: 48 c7 04 24 00 00 00 movq $0x0,(%rsp)
c: 00
d: 9c pushfq
e: 8f 04 24 popq (%rsp)
11: f7 04 24 00 02 00 00 testl $0x200,(%rsp)
18: 0f 85 83 00 00 00 jne 0xa1
1e: 41 f7 c7 00 02 00 00 test $0x200,%r15d
25: 74 01 je 0x28
27: fb sti
28: 31 c0 xor %eax,%eax
* 2a: 48 83 c4 08 add $0x8,%rsp <-- trapping instruction
2e: 5b pop %rbx
2f: 41 5c pop %r12
31: 41 5d pop %r13
33: 41 5e pop %r14
35: 41 5f pop %r15
37: c3 retq
38: 48 8d 80 00 56 03 00 lea 0x35600(%rax),%rax
3f: 45 rex.RB