==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x6ee/0x2890 net/ipv4/tcp_timer.c:515
Read of size 8 at addr ffff88801e209c98 by task sed/26379
CPU: 1 PID: 26379 Comm: sed Not tainted 5.15.111-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/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:1096
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638
RIP: 0010:finish_lock_switch+0x91/0x100 kernel/sched/core.c:4781
Code: 45 31 c9 68 57 43 59 81 e8 fc 14 09 00 48 83 c4 08 4c 89 ff e8 40 d9 fe ff 66 90 4c 89 ff e8 26 6c ca 08 e8 c1 10 2d 00 fb 5b <41> 5c 41 5d 41 5e 41 5f c3 44 89 f1 80 e1 07 80 c1 03 38 c1 7c 87
RSP: 0018:ffffc900030af238 EFLAGS: 00000286
RAX: 553a42b357346e00 RBX: ffff88807a11bbb4 RCX: ffffffff8162c608
RDX: dffffc0000000000 RSI: ffffffff8a8afb60 RDI: ffffffff8ad85bc0
RBP: ffffc900030af2b0 R08: dffffc0000000000 R09: fffffbfff1f78e27
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 1ffff1101736747b R14: ffff8880b9b3a3d8 R15: ffff8880b9b39680
finish_task_switch+0x134/0x630 kernel/sched/core.c:4898
context_switch kernel/sched/core.c:5029 [inline]
__schedule+0x12cc/0x4590 kernel/sched/core.c:6372
preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6776
irqentry_exit+0x53/0x80 kernel/entry/common.c:426
asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:643
RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x60 kernel/kcov.c:193
Code: 1f 84 00 00 00 00 00 0f 1f 00 53 48 89 fb e8 17 00 00 00 48 8b 3d 08 c5 63 0c 48 89 de 5b e9 f7 83 48 00 cc cc cc cc cc cc cc <48> 8b 04 24 65 48 8b 0d d4 8b 82 7e 65 8b 15 d5 8b 82 7e f7 c2 00
RSP: 0018:ffffc900030af610 EFLAGS: 00000283
RAX: 0000000000000001 RBX: ffff88805594d358 RCX: ffff88804e425940
RDX: 0000000000000000 RSI: 0000000000000014 RDI: ffff88804f7d6200
RBP: ffffc900030af6f0 R08: ffffffff81b50eb6 R09: ffff88804e425e68
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000014
R13: dffffc0000000000 R14: 1ffff92000615ec8 R15: ffff88804f7d6200
rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:268
rcu_read_lock include/linux/rcupdate.h:696 [inline]
count_memcg_event_mm+0x8d/0x3e0 include/linux/memcontrol.h:1073
handle_mm_fault+0x161/0x5950 mm/memory.c:4821
do_user_addr_fault arch/x86/mm/fault.c:1397 [inline]
handle_page_fault arch/x86/mm/fault.c:1485 [inline]
exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1541
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0010:__clear_user arch/x86/lib/usercopy_64.c:24 [inline]
RIP: 0010:clear_user+0xe0/0x150 arch/x86/lib/usercopy_64.c:54
Code: 1e 8c be 14 00 00 00 e8 1e 41 8a fd 0f 01 cb 44 89 f8 83 e0 07 49 c1 ef 03 4c 89 f9 4c 89 f7 48 85 c9 74 15 66 0f 1f 44 00 00 <48> c7 07 00 00 00 00 48 83 c7 08 ff c9 75 f1 48 89 c1 85 c9 74 0a
RSP: 0018:ffffc900030afad8 EFLAGS: 00050206
RAX: 0000000000000000 RBX: 0000555d23ffe000 RCX: 00000000000001ff
RDX: 0000000000000000 RSI: ffffffff8a8b0e00 RDI: 0000555d23ffd008
RBP: ffffc900030afd30 R08: dffffc0000000000 R09: fffffbfff1bc74d6
R10: 0000000000000000 R11: dffffc0000000001 R12: 00007ffffffff000
R13: 0000000000004008 R14: 0000555d23ffd008 R15: 00000000000001ff
padzero fs/binfmt_elf.c:141 [inline]
load_elf_binary+0x1a47/0x2750 fs/binfmt_elf.c:1221
search_binary_handler fs/exec.c:1734 [inline]
exec_binprm fs/exec.c:1775 [inline]
bprm_execve+0x8fd/0x17c0 fs/exec.c:1844
do_execveat_common+0x583/0x720 fs/exec.c:1949
do_execve fs/exec.c:2019 [inline]
__do_sys_execve fs/exec.c:2095 [inline]
__se_sys_execve fs/exec.c:2090 [inline]
__x64_sys_execve+0x8e/0xa0 fs/exec.c:2090
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:0x7f26ffbb1ef7
Code: Unable to access opcode bytes at RIP 0x7f26ffbb1ecd.
RSP: 002b:00007fffddd81f08 EFLAGS: 00000246 ORIG_RAX: 000000000000003b
RAX: ffffffffffffffda RBX: 0000562029e0dec0 RCX: 00007f26ffbb1ef7
RDX: 0000562029e0df08 RSI: 0000562029e0dec0 RDI: 0000562029e0df98
RBP: 0000562029e0df98 R08: 0000562029e0df9d R09: 00007fffddd87e64
R10: 00007f26ffdaa088 R11: 0000000000000246 R12: 0000562029e0df08
R13: 00007f26ffd5f904 R14: 0000562029e0df08 R15: 0000000000000000
Allocated by task 13688:
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 ffff88801e209a40
which belongs to the cache net_namespace of size 6464
The buggy address is located 600 bytes inside of
6464-byte region [ffff88801e209a40, ffff88801e20b380)
The buggy address belongs to the page:
page:ffffea0000788200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801e209a40 pfn:0x1e208
head:ffffea0000788200 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88801d5def01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001366008 ffffea0001da7408 ffff888011dc63c0
raw: ffff88801e209a40 0000000000040000 00000001ffffffff ffff88801d5def01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 6350, ts 238304791613, free_ts 237377745611
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
copy_namespaces+0x365/0x3b0 kernel/nsproxy.c:178
copy_process+0x1841/0x3ef0 kernel/fork.c:2201
kernel_clone+0x210/0x960 kernel/fork.c:2601
__do_sys_clone kernel/fork.c:2718 [inline]
__se_sys_clone kernel/fork.c:2702 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2702
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_kmalloc+0x2f/0xf0 mm/kasan/common.c:479
kasan_kmalloc include/linux/kasan.h:264 [inline]
__kmalloc_node_track_caller+0x195/0x390 mm/slub.c:4963
kmalloc_reserve net/core/skbuff.c:356 [inline]
__alloc_skb+0x12c/0x590 net/core/skbuff.c:427
alloc_skb include/linux/skbuff.h:1167 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
inet6_netconf_notify_devconf+0xf8/0x1b0 net/ipv6/addrconf.c:582
__addrconf_sysctl_unregister net/ipv6/addrconf.c:7091 [inline]
addrconf_exit_net+0x1a2/0x200 net/ipv6/addrconf.c:7196
ops_exit_list net/core/net_namespace.c:169 [inline]
setup_net+0x78f/0x9e0 net/core/net_namespace.c:352
copy_net_ns+0x395/0x5d0 net/core/net_namespace.c:473
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
copy_namespaces+0x365/0x3b0 kernel/nsproxy.c:178
Memory state around the buggy address:
ffff88801e209b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801e209c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801e209c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801e209d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801e209d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 45 31 c9 xor %r9d,%r9d
3: 68 57 43 59 81 pushq $0xffffffff81594357
8: e8 fc 14 09 00 callq 0x91509
d: 48 83 c4 08 add $0x8,%rsp
11: 4c 89 ff mov %r15,%rdi
14: e8 40 d9 fe ff callq 0xfffed959
19: 66 90 xchg %ax,%ax
1b: 4c 89 ff mov %r15,%rdi
1e: e8 26 6c ca 08 callq 0x8ca6c49
23: e8 c1 10 2d 00 callq 0x2d10e9
28: fb sti
29: 5b pop %rbx
* 2a: 41 5c pop %r12 <-- trapping instruction
2c: 41 5d pop %r13
2e: 41 5e pop %r14
30: 41 5f pop %r15
32: c3 retq
33: 44 89 f1 mov %r14d,%ecx
36: 80 e1 07 and $0x7,%cl
39: 80 c1 03 add $0x3,%cl
3c: 38 c1 cmp %al,%cl
3e: 7c 87 jl 0xffffffc7