================================================================== BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:384 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x78c/0x8a8 net/ipv4/tcp_timer.c:648 Read of size 1 at addr ffff0000c9a1a0cd by task kworker/u4:3/297 CPU: 1 PID: 297 Comm: kworker/u4:3 Not tainted 5.15.152-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Workqueue: loop2 loop_workfn 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_load1_noabort+0x44/0x50 mm/kasan/report_generic.c:306 tcp_probe_timer net/ipv4/tcp_timer.c:384 [inline] tcp_write_timer_handler+0x78c/0x8a8 net/ipv4/tcp_timer.c:648 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] invoke_softirq kernel/softirq.c:439 [inline] __irq_exit_rcu+0x264/0x4d4 kernel/softirq.c:637 irq_exit+0x14/0x88 kernel/softirq.c:661 handle_domain_irq+0xf4/0x178 kernel/irq/irqdesc.c:710 gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:758 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:899 do_interrupt_handler+0x74/0x94 arch/arm64/kernel/entry-common.c:267 el1_interrupt+0x30/0x58 arch/arm64/kernel/entry-common.c:454 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:470 el1h_64_irq+0x78/0x7c arch/arm64/kernel/entry.S:580 arch_local_irq_restore arch/arm64/include/asm/irqflags.h:122 [inline] seqcount_lockdep_reader_access+0x228/0x2cc include/linux/seqlock.h:105 ktime_get_coarse_real_ts64+0x44/0x134 kernel/time/timekeeping.c:2244 current_time+0x94/0x2b0 fs/inode.c:2327 atime_needs_update+0x374/0x6b8 fs/inode.c:1867 touch_atime+0xf0/0xa4c fs/inode.c:1884 file_accessed include/linux/fs.h:2492 [inline] shmem_file_read_iter+0x1e8/0x7b8 mm/shmem.c:2640 do_iter_readv_writev+0x420/0x5f8 do_iter_read+0x1c4/0x67c fs/read_write.c:790 vfs_iter_read+0x88/0xac fs/read_write.c:832 lo_read_simple drivers/block/loop.c:392 [inline] do_req_filebacked drivers/block/loop.c:663 [inline] loop_handle_cmd drivers/block/loop.c:2234 [inline] loop_process_work+0x19f0/0x2798 drivers/block/loop.c:2274 loop_workfn+0x54/0x68 drivers/block/loop.c:2298 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:319 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Allocated by task 3989: 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 Freed by task 4215: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0xdc/0x3c4 mm/slub.c:3515 net_free net/core/net_namespace.c:434 [inline] cleanup_net+0x8a0/0x9bc net/core/net_namespace.c:617 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:319 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 The buggy address belongs to the object at ffff0000c9a19a40 which belongs to the cache net_namespace of size 6464 The buggy address is located 1677 bytes inside of 6464-byte region [ffff0000c9a19a40, ffff0000c9a1b380) The buggy address belongs to the page: page:00000000fd4aa85c refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000c9a1cec0 pfn:0x109a18 head:00000000fd4aa85c order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 0000000100000001 ffff0000c0840000 raw: ffff0000c9a1cec0 0000000080040002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c9a19f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c9a1a000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000c9a1a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000c9a1a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c9a1a180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================