================================================================== 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 ffff0000ca5b068d by task udevd/3584 CPU: 0 PID: 3584 Comm: udevd Not tainted 5.15.152-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 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/0x2d0 include/linux/seqlock.h:105 read_seqbegin include/linux/seqlock.h:840 [inline] read_seqbegin_or_lock include/linux/seqlock.h:1144 [inline] prepend_path+0xd8/0xaf8 fs/d_path.c:167 d_absolute_path+0x13c/0x27c fs/d_path.c:235 tomoyo_get_absolute_path security/tomoyo/realpath.c:101 [inline] tomoyo_realpath_from_path+0x2a4/0x508 security/tomoyo/realpath.c:276 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x1dc/0x3f4 security/tomoyo/file.c:771 tomoyo_file_open+0x138/0x1b0 security/tomoyo/tomoyo.c:311 security_file_open+0x6c/0xb0 security/security.c:1668 do_dentry_open+0x29c/0xed8 fs/open.c:813 vfs_open+0x7c/0x90 fs/open.c:956 do_open fs/namei.c:3608 [inline] path_openat+0x1f28/0x26f0 fs/namei.c:3742 do_filp_open+0x1a8/0x3b4 fs/namei.c:3769 do_sys_openat2+0x128/0x3d8 fs/open.c:1211 do_sys_open fs/open.c:1227 [inline] __do_sys_openat fs/open.c:1243 [inline] __se_sys_openat fs/open.c:1238 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1238 __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 3999: 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 1708: 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 ffff0000ca5b0000 which belongs to the cache net_namespace of size 6464 The buggy address is located 1677 bytes inside of 6464-byte region [ffff0000ca5b0000, ffff0000ca5b1940) The buggy address belongs to the page: page:00000000e9651ed4 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000ca5b1a40 pfn:0x10a5b0 head:00000000e9651ed4 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000c9f03501 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 0000000100000001 ffff0000c0840000 raw: ffff0000ca5b1a40 0000000080040003 00000001ffffffff ffff0000c9f03501 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000ca5b0580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ca5b0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000ca5b0680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000ca5b0700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ca5b0780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================