================================================================== BUG: KASAN: use-after-free in tcp_retransmit_timer+0x59c/0x1da8 net/ipv4/tcp_timer.c:535 Read of size 8 at addr ffff0001367e1f00 by task kworker/u4:11/13325 CPU: 0 PID: 13325 Comm: kworker/u4:11 Not tainted 6.1.82-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Workqueue: netns cleanup_net Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:395 kasan_report+0xd4/0x130 mm/kasan/report.c:495 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 tcp_retransmit_timer+0x59c/0x1da8 net/ipv4/tcp_timer.c:535 tcp_write_timer_handler+0x18c/0x808 net/ipv4/tcp_timer.c:648 tcp_write_timer+0x170/0x2e4 net/ipv4/tcp_timer.c:665 call_timer_fn+0x1c0/0xa1c kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x554/0x718 kernel/time/timer.c:1790 run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1803 __do_softirq+0x314/0xe38 kernel/softirq.c:571 ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:893 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:85 invoke_softirq kernel/softirq.c:452 [inline] __irq_exit_rcu+0x264/0x4d4 kernel/softirq.c:650 irq_exit_rcu+0x14/0x84 kernel/softirq.c:662 __el1_irq arch/arm64/kernel/entry-common.c:472 [inline] el1_interrupt+0x38/0x68 arch/arm64/kernel/entry-common.c:486 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:491 el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:581 arch_local_irq_enable arch/arm64/include/asm/irqflags.h:35 [inline] __local_bh_enable_ip+0x238/0x470 kernel/softirq.c:401 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline] _raw_spin_unlock_bh+0x48/0x58 kernel/locking/spinlock.c:210 spin_unlock_bh include/linux/spinlock.h:396 [inline] tcp_metrics_flush_all+0x288/0x348 net/ipv4/tcp_metrics.c:916 tcp_net_metrics_exit_batch+0x18/0x24 net/ipv4/tcp_metrics.c:1036 ops_exit_list net/core/net_namespace.c:174 [inline] cleanup_net+0x5dc/0x994 net/core/net_namespace.c:601 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2292 worker_thread+0x8e4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 Allocated by task 14245: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x74/0x458 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+0x230/0x37c 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+0x124/0x590 net/core/net_namespace.c:465 create_new_namespaces+0x344/0x614 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x108/0x158 kernel/nsproxy.c:226 ksys_unshare+0x45c/0x874 kernel/fork.c:3203 __do_sys_unshare kernel/fork.c:3274 [inline] __se_sys_unshare kernel/fork.c:3272 [inline] __arm64_sys_unshare+0x3c/0x50 kernel/fork.c:3272 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 Freed by task 13325: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x2f0/0x588 mm/slub.c:3683 net_free net/core/net_namespace.c:439 [inline] cleanup_net+0x888/0x994 net/core/net_namespace.c:622 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2292 worker_thread+0x8e4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 The buggy address belongs to the object at ffff0001367e1c40 which belongs to the cache net_namespace of size 6976 The buggy address is located 704 bytes inside of 6976-byte region [ffff0001367e1c40, ffff0001367e3780) The buggy address belongs to the physical page: page:00000000ad0b341c refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0001367e0000 pfn:0x1767e0 head:00000000ad0b341c order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000d1591f01 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 fffffc0004c20000 dead000000000002 ffff0000c03de180 raw: ffff0001367e0000 0000000080040002 00000001ffffffff ffff0000d1591f01 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0001367e1e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0001367e1e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0001367e1f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0001367e1f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0001367e2000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== TCP: request_sock_TCP: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters.