================================================================== BUG: KASAN: use-after-free in tcp_retransmit_timer+0x594/0x1d3c net/ipv4/tcp_timer.c:531 Read of size 8 at addr ffff000100491c98 by task syz-fuzzer/3971 CPU: 0 PID: 3971 Comm: syz-fuzzer Not tainted 5.15.148-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309 tcp_retransmit_timer+0x594/0x1d3c net/ipv4/tcp_timer.c:531 tcp_write_timer_handler+0x1e8/0x8a8 net/ipv4/tcp_timer.c:644 tcp_write_timer+0x178/0x318 net/ipv4/tcp_timer.c:664 call_timer_fn+0x19c/0x8f0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers+0x554/0x718 kernel/time/timer.c:1737 run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1750 __do_softirq+0x344/0xdb0 kernel/softirq.c:558 do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline] do_softirq+0xf8/0x1ac kernel/softirq.c:459 __local_bh_enable_ip+0x298/0x470 kernel/softirq.c:383 local_bh_enable+0x28/0x1d0 include/linux/bottom_half.h:32 rcu_read_unlock_bh include/linux/rcupdate.h:766 [inline] ip_finish_output2+0xe78/0x131c net/ipv4/ip_output.c:229 __ip_finish_output+0x1b0/0x458 ip_finish_output+0x40/0x218 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip_output+0x330/0x49c net/ipv4/ip_output.c:430 dst_output include/net/dst.h:443 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0xe70/0x1930 net/ipv4/ip_output.c:532 ip_queue_xmit+0x5c/0x78 net/ipv4/ip_output.c:546 __tcp_transmit_skb+0x1944/0x31e8 net/ipv4/tcp_output.c:1402 tcp_transmit_skb net/ipv4/tcp_output.c:1420 [inline] tcp_write_xmit+0x12bc/0x4dc0 net/ipv4/tcp_output.c:2705 __tcp_push_pending_frames+0x98/0x228 net/ipv4/tcp_output.c:2890 tcp_push+0x41c/0x648 net/ipv4/tcp.c:736 tcp_sendmsg_locked+0x2864/0x30a8 net/ipv4/tcp.c:1427 tcp_sendmsg+0x40/0x64 net/ipv4/tcp.c:1455 inet_sendmsg+0x15c/0x290 net/ipv4/af_inet.c:825 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] sock_write_iter+0x2b0/0x3f8 net/socket.c:1079 call_write_iter include/linux/fs.h:2146 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x87c/0xb3c fs/read_write.c:594 ksys_write+0x15c/0x26c fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:656 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Allocated by task 4003: 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+0x8c/0xcc mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x74/0x3f4 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x1dc/0x45c 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+0x128/0x5e4 net/core/net_namespace.c:460 create_new_namespaces+0x330/0x61c kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x108/0x158 kernel/nsproxy.c:226 ksys_unshare+0x45c/0x874 kernel/fork.c:3101 __do_sys_unshare kernel/fork.c:3175 [inline] __se_sys_unshare kernel/fork.c:3173 [inline] __arm64_sys_unshare+0x3c/0x50 kernel/fork.c:3173 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 The buggy address belongs to the object at ffff000100491a40 which belongs to the cache net_namespace of size 6464 The buggy address is located 600 bytes inside of 6464-byte region [ffff000100491a40, ffff000100493380) The buggy address belongs to the page: page:00000000aeae26d0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x140490 head:00000000aeae26d0 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0838000 raw: 0000000000000000 0000000080040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff000100491b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff000100491c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff000100491c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff000100491d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff000100491d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================