================================================================== BUG: KASAN: use-after-free in notifier_call_chain+0x1ee/0x200 kernel/notifier.c:75 Read of size 8 at addr ffff88804127bae8 by task syz-executor.1/32022 CPU: 1 PID: 32022 Comm: syz-executor.1 Not tainted 6.1.0-rc1-syzkaller-00427-gd47136c28015 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 notifier_call_chain+0x1ee/0x200 kernel/notifier.c:75 call_netdevice_notifiers_info+0x86/0x130 net/core/dev.c:1942 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] netdev_wait_allrefs_any net/core/dev.c:10237 [inline] netdev_run_todo+0xbc2/0x1100 net/core/dev.c:10351 tun_detach drivers/net/tun.c:704 [inline] tun_chr_close+0xe0/0x180 drivers/net/tun.c:3458 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16b/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xb35/0x2a20 kernel/exit.c:820 do_group_exit+0xd0/0x2a0 kernel/exit.c:950 __do_sys_exit_group kernel/exit.c:961 [inline] __se_sys_exit_group kernel/exit.c:959 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:959 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd9eb88b5f9 Code: Unable to access opcode bytes at 0x7fd9eb88b5cf. RSP: 002b:00007ffc3cb40b38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007ffc3cb40ce0 RCX: 00007fd9eb88b5f9 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 0000000000000000 R08: 0000000000000025 R09: 00007ffc3cb40ce0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd9eb8e6781 R13: 000000000000001c R14: 0000000000000002 R15: 00007ffc3cb40d20 Allocated by task 32022: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7e/0x80 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] 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+0x2ac/0x3c0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:702 [inline] net_alloc net/core/net_namespace.c:403 [inline] copy_net_ns+0x125/0x760 net/core/net_namespace.c:458 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3188 __do_sys_unshare kernel/fork.c:3259 [inline] __se_sys_unshare kernel/fork.c:3257 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3257 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 4475: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] kmem_cache_free+0xea/0x5b0 mm/slub.c:3683 net_free net/core/net_namespace.c:432 [inline] net_free net/core/net_namespace.c:428 [inline] cleanup_net+0x8ba/0xb00 net/core/net_namespace.c:615 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x693/0x13b0 kernel/workqueue.c:1517 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1805 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x693/0x13b0 kernel/workqueue.c:1517 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1805 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 The buggy address belongs to the object at ffff88804127b880 which belongs to the cache net_namespace of size 6976 The buggy address is located 616 bytes inside of 6976-byte region [ffff88804127b880, ffff88804127d3c0) The buggy address belongs to the physical page: page:ffffea0001049e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888041279c40 pfn:0x41278 head:ffffea0001049e00 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff8880714989c1 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff8880119d6500 raw: ffff888041279c40 0000000080040001 00000001ffffffff ffff8880714989c1 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 4688, tgid 4675 (syz-executor.0), ts 146278430040, free_ts 146272266294 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4287 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5554 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x213/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x312/0x3c0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:702 [inline] net_alloc net/core/net_namespace.c:403 [inline] copy_net_ns+0x125/0x760 net/core/net_namespace.c:458 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3188 __do_sys_unshare kernel/fork.c:3259 [inline] __se_sys_unshare kernel/fork.c:3257 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3257 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3482 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2586 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x62/0x80 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] 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+0x2ac/0x3c0 mm/slub.c:3422 getname_flags.part.0+0x50/0x4f0 fs/namei.c:139 getname_flags+0x9a/0xe0 include/linux/audit.h:320 user_path_at_empty+0x2b/0x60 fs/namei.c:2875 do_readlinkat+0xcd/0x2f0 fs/stat.c:468 __do_sys_readlink fs/stat.c:501 [inline] __se_sys_readlink fs/stat.c:498 [inline] __x64_sys_readlink+0x74/0xb0 fs/stat.c:498 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88804127b980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804127ba00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804127ba80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804127bb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804127bb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================