==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x2ef3/0x3360 net/ipv4/tcp_timer.c:511
Read of size 8 at addr ffff88807ad49e40 by task syz-executor.3/31127
CPU: 0 PID: 31127 Comm: syz-executor.3 Not tainted 5.18.0-rc3-syzkaller-01632-gc272e2591169 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313
print_report mm/kasan/report.c:429 [inline]
kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491
tcp_retransmit_timer+0x2ef3/0x3360 net/ipv4/tcp_timer.c:511
tcp_write_timer_handler+0x5e6/0xbc0 net/ipv4/tcp_timer.c:622
tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:642
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers.part.0+0x679/0xa80 kernel/time/timer.c:1737
__run_timers kernel/time/timer.c:1715 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1750
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:__sanitizer_cov_trace_pc+0x59/0x60 kernel/kcov.c:208
Code: 74 2b 8b 82 80 15 00 00 83 f8 02 75 20 48 8b 8a 88 15 00 00 8b 92 84 15 00 00 48 8b 01 48 83 c0 01 48 39 c2 76 07 48 89 34 c1 <48> 89 01 c3 0f 1f 00 41 55 41 54 49 89 fc 55 48 bd eb 83 b5 80 46
RSP: 0018:ffffc9000b1471d0 EFLAGS: 00000212
RAX: 000000000000354b RBX: 0000000000000001 RCX: ffffc9000c425000
RDX: 0000000000040000 RSI: ffffffff819ff55b RDI: 0000000000000003
RBP: ffffc9000b147270 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff819ff6ab R11: 000000000000003f R12: ffff88801bb72680
R13: ffffea0000790a80 R14: ffff88801b8398f0 R15: dffffc0000000000
xa_is_internal include/linux/xarray.h:170 [inline]
xa_is_sibling include/linux/xarray.h:1250 [inline]
xas_reload+0x11b/0x440 include/linux/xarray.h:1562
mapping_get_entry mm/filemap.c:1897 [inline]
__filemap_get_folio+0x230/0xf00 mm/filemap.c:1946
pagecache_get_page+0x2e/0x290 mm/folio-compat.c:126
find_get_page_flags include/linux/pagemap.h:571 [inline]
ext4_mb_load_buddy_gfp+0x626/0x1350 fs/ext4/mballoc.c:1568
ext4_mb_load_buddy fs/ext4/mballoc.c:1616 [inline]
ext4_mb_regular_allocator+0xb67/0x3610 fs/ext4/mballoc.c:2754
ext4_mb_new_blocks+0x236e/0x4f50 fs/ext4/mballoc.c:5616
ext4_ext_map_blocks+0x218d/0x5f60 fs/ext4/extents.c:4281
ext4_map_blocks+0x653/0x18a0 fs/ext4/inode.c:636
ext4_getblk+0x144/0x6b0 fs/ext4/inode.c:847
ext4_bread+0x2a/0x1c0 fs/ext4/inode.c:900
ext4_append+0x177/0x3a0 fs/ext4/namei.c:67
ext4_init_new_dir+0x25e/0x4d0 fs/ext4/namei.c:2893
ext4_mkdir+0x3cf/0xb20 fs/ext4/namei.c:2939
vfs_mkdir+0x1c3/0x3b0 fs/namei.c:3931
do_mkdirat+0x285/0x300 fs/namei.c:3957
__do_sys_mkdir fs/namei.c:3977 [inline]
__se_sys_mkdir fs/namei.c:3975 [inline]
__x64_sys_mkdir+0xf2/0x140 fs/namei.c:3975
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+0x44/0xae
RIP: 0033:0x7fb9862890e9
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:00007fb987331168 EFLAGS: 00000246 ORIG_RAX: 0000000000000053
RAX: ffffffffffffffda RBX: 00007fb98639bf60 RCX: 00007fb9862890e9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000280
RBP: 00007fb9862e308d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc7d439daf R14: 00007fb987331300 R15: 0000000000022000
Allocated by task 21472:
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:436 [inline]
__kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469
kasan_slab_alloc include/linux/kasan.h:224 [inline]
slab_post_alloc_hook mm/slab.h:749 [inline]
slab_alloc_node mm/slub.c:3217 [inline]
slab_alloc mm/slub.c:3225 [inline]
__kmem_cache_alloc_lru mm/slub.c:3232 [inline]
kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3242
kmem_cache_zalloc include/linux/slab.h:704 [inline]
net_alloc net/core/net_namespace.c:403 [inline]
copy_net_ns+0x125/0x760 net/core/net_namespace.c:458
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:3132
__do_sys_unshare kernel/fork.c:3203 [inline]
__se_sys_unshare kernel/fork.c:3201 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3201
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+0x44/0xae
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+0x62e/0x1140 kernel/workqueue.c:1517
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1461 [inline]
__run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1737
__run_timers kernel/time/timer.c:1715 [inline]
run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1752
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
The buggy address belongs to the object at ffff88807ad49b80
which belongs to the cache net_namespace of size 6784
The buggy address is located 704 bytes inside of
6784-byte region [ffff88807ad49b80, ffff88807ad4b600)
The buggy address belongs to the physical page:
page:ffffea0001eb5200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807ad49b80 pfn:0x7ad48
head:ffffea0001eb5200 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888011bb92c1
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea000110b408 ffffea0001169208 ffff8881400063c0
raw: ffff88807ad49b80 0000000000040002 00000001ffffffff ffff888011bb92c1
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 3627, tgid 3627 (syz-executor.2), ts 132227543314, free_ts 124064303293
prep_new_page mm/page_alloc.c:2441 [inline]
get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408
alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272
alloc_slab_page mm/slub.c:1799 [inline]
allocate_slab+0x26c/0x3c0 mm/slub.c:1944
new_slab mm/slub.c:2004 [inline]
___slab_alloc+0x8df/0xf20 mm/slub.c:3005
__slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3092
slab_alloc_node mm/slub.c:3183 [inline]
slab_alloc mm/slub.c:3225 [inline]
__kmem_cache_alloc_lru mm/slub.c:3232 [inline]
kmem_cache_alloc+0x360/0x3b0 mm/slub.c:3242
kmem_cache_zalloc include/linux/slab.h:704 [inline]
net_alloc net/core/net_namespace.c:403 [inline]
copy_net_ns+0x125/0x760 net/core/net_namespace.c:458
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:3132
__do_sys_unshare kernel/fork.c:3203 [inline]
__se_sys_unshare kernel/fork.c:3201 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3201
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+0x44/0xae
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1356 [inline]
free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406
free_unref_page_prepare mm/page_alloc.c:3328 [inline]
free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423
__unfreeze_partials+0x17c/0x1a0 mm/slub.c:2523
qlink_free mm/kasan/quarantine.c:157 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446
kasan_slab_alloc include/linux/kasan.h:224 [inline]
slab_post_alloc_hook mm/slab.h:749 [inline]
slab_alloc_node mm/slub.c:3217 [inline]
kmem_cache_alloc_node+0x255/0x3f0 mm/slub.c:3267
__alloc_skb+0x215/0x340 net/core/skbuff.c:414
alloc_skb_fclone include/linux/skbuff.h:1390 [inline]
tcp_stream_alloc_skb+0x66/0x900 net/ipv4/tcp.c:862
tcp_sendmsg_locked+0xac8/0x2fb0 net/ipv4/tcp.c:1297
tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1448
inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819
sock_sendmsg_nosec net/socket.c:705 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:725
sock_write_iter+0x283/0x3c0 net/socket.c:1061
call_write_iter include/linux/fs.h:2050 [inline]
new_sync_write+0x38a/0x560 fs/read_write.c:504
vfs_write+0x7c0/0xac0 fs/read_write.c:591
Memory state around the buggy address:
ffff88807ad49d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807ad49d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807ad49e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807ad49e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807ad49f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 74 2b je 0x2d
2: 8b 82 80 15 00 00 mov 0x1580(%rdx),%eax
8: 83 f8 02 cmp $0x2,%eax
b: 75 20 jne 0x2d
d: 48 8b 8a 88 15 00 00 mov 0x1588(%rdx),%rcx
14: 8b 92 84 15 00 00 mov 0x1584(%rdx),%edx
1a: 48 8b 01 mov (%rcx),%rax
1d: 48 83 c0 01 add $0x1,%rax
21: 48 39 c2 cmp %rax,%rdx
24: 76 07 jbe 0x2d
26: 48 89 34 c1 mov %rsi,(%rcx,%rax,8)
* 2a: 48 89 01 mov %rax,(%rcx) <-- trapping instruction
2d: c3 retq
2e: 0f 1f 00 nopl (%rax)
31: 41 55 push %r13
33: 41 54 push %r12
35: 49 89 fc mov %rdi,%r12
38: 55 push %rbp
39: 48 rex.W
3a: bd eb 83 b5 80 mov $0x80b583eb,%ebp
3f: 46 rex.RX