================================================================== 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 tcp_metrics_flush_all net/ipv4/tcp_metrics.c:909 [inline] BUG: KASAN: use-after-free in tcp_net_metrics_exit_batch+0x93/0x1a0 net/ipv4/tcp_metrics.c:1036 Read of size 4 at addr ffff8881261d1344 by task kworker/u4:4/501 CPU: 1 PID: 501 Comm: kworker/u4:4 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] tcp_metrics_flush_all net/ipv4/tcp_metrics.c:909 [inline] tcp_net_metrics_exit_batch+0x93/0x1a0 net/ipv4/tcp_metrics.c:1036 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 15186: 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 2955: 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 ffff8881261d1340 which belongs to the cache net_namespace of size 4672 The buggy address is located 4 bytes inside of 4672-byte region [ffff8881261d1340, ffff8881261d2580) The buggy address belongs to the page: page:ffffea0004987400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881261d4d00 pfn:0x1261d0 head:ffffea0004987400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 ffffea0004b99008 ffff888107fa7f90 ffff888107fddb00 raw: ffff8881261d4d00 0000000000060002 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 277, ts 21472049023, free_ts 0 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_owner free stack trace missing Memory state around the buggy address: ffff8881261d1200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8881261d1280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881261d1300: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff8881261d1380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881261d1400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================