================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:147 [inline] BUG: KASAN: use-after-free in inet_twsk_purge+0x1fe/0x620 net/ipv4/inet_timewait_sock.c:278 Read of size 4 at addr ffff88810f9c4d04 by task kworker/u4:1/9 CPU: 0 PID: 9 Comm: kworker/u4:1 Tainted: G W 5.10.238-syzkaller-00282-gd76d4cd0623a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Workqueue: netns cleanup_net Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 mm/kasan/report.c:452 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x280/0x290 mm/kasan/generic.c:189 __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_read include/asm-generic/atomic-instrumented.h:27 [inline] refcount_read include/linux/refcount.h:147 [inline] inet_twsk_purge+0x1fe/0x620 net/ipv4/inet_timewait_sock.c:278 tcpv6_net_exit_batch+0x1a/0x20 net/ipv6/tcp_ipv6.c:2194 ops_exit_list net/core/net_namespace.c:190 [inline] cleanup_net+0x5fb/0xb70 net/core/net_namespace.c:609 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447 kthread+0x346/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 12437: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] __kasan_slab_alloc+0xbd/0xf0 mm/kasan/common.c:463 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x165/0x2e0 mm/slub.c:2960 kmem_cache_zalloc include/linux/slab.h:654 [inline] net_alloc net/core/net_namespace.c:421 [inline] copy_net_ns+0x13f/0x520 net/core/net_namespace.c:473 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:231 ksys_unshare+0x4ac/0x7d0 kernel/fork.c:3156 __do_sys_unshare kernel/fork.c:3224 [inline] __se_sys_unshare kernel/fork.c:3222 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3222 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 9: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kmem_cache_free+0x100/0x2d0 mm/slub.c:3219 net_free net/core/net_namespace.c:449 [inline] net_drop_ns net/core/net_namespace.c:456 [inline] cleanup_net+0xae3/0xb70 net/core/net_namespace.c:630 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447 kthread+0x346/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff88810f9c4d00 which belongs to the cache net_namespace of size 4672 The buggy address is located 4 bytes inside of 4672-byte region [ffff88810f9c4d00, ffff88810f9c5f40) The buggy address belongs to the page: page:ffffea00043e7000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88810f9c0000 pfn:0x10f9c0 head:ffffea00043e7000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 0000000000000000 0000000100000001 ffff888107fdd200 raw: ffff88810f9c0000 0000000080060005 00000001ffffffff 0000000000000000 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 963, ts 51202081513, free_ts 51198751875 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5357 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1808 [inline] new_slab+0x84/0x3f0 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x2a6/0x450 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x1af/0x2e0 mm/slub.c:2960 kmem_cache_zalloc include/linux/slab.h:654 [inline] net_alloc net/core/net_namespace.c:421 [inline] copy_net_ns+0x13f/0x520 net/core/net_namespace.c:473 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:231 ksys_unshare+0x4ac/0x7d0 kernel/fork.c:3156 __do_sys_unshare kernel/fork.c:3224 [inline] __se_sys_unshare kernel/fork.c:3222 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3222 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] __free_pages_ok+0x7fc/0x820 mm/page_alloc.c:1629 free_the_page mm/page_alloc.c:5418 [inline] __free_pages+0xdd/0x380 mm/page_alloc.c:5427 __free_slab+0xcf/0x190 mm/slub.c:1894 free_slab mm/slub.c:1909 [inline] discard_slab mm/slub.c:1915 [inline] unfreeze_partials+0x15f/0x190 mm/slub.c:2410 put_cpu_partial+0xc1/0x180 mm/slub.c:2446 __slab_free+0x2c9/0x3a0 mm/slub.c:3095 do_slab_free mm/slub.c:3191 [inline] ___cache_free+0x111/0x130 mm/slub.c:3210 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x5f/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x14a/0x160 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xf0 mm/kasan/common.c:440 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x165/0x2e0 mm/slub.c:2960 getname_flags+0xb9/0x500 fs/namei.c:141 getname+0x19/0x20 fs/namei.c:212 do_sys_openat2+0xd9/0x6d0 fs/open.c:1211 Memory state around the buggy address: ffff88810f9c4c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810f9c4c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810f9c4d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810f9c4d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810f9c4e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== tipc: Disabling bearer tipc: Left network mode device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state device veth1_macvtap left promiscuous mode device veth0_vlan left promiscuous mode device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state device veth1_macvtap left promiscuous mode device veth0_vlan left promiscuous mode device veth1_macvtap left promiscuous mode device veth0_vlan left promiscuous mode device veth1_macvtap left promiscuous mode device veth0_vlan left promiscuous mode