================================================================== BUG: KASAN: use-after-free in notifier_call_chain kernel/notifier.c:72 [inline] BUG: KASAN: use-after-free in raw_notifier_call_chain+0x3e/0x170 kernel/notifier.c:392 Read of size 8 at addr ffff88807632b968 by task syz-executor.0/4808 CPU: 1 PID: 4808 Comm: syz-executor.0 Not tainted 5.18.0-rc1-syzkaller-00009-gce4c854ee868 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:313 print_report+0xf4/0x200 mm/kasan/report.c:429 kasan_report+0x109/0x140 mm/kasan/report.c:491 notifier_call_chain kernel/notifier.c:72 [inline] raw_notifier_call_chain+0x3e/0x170 kernel/notifier.c:392 call_netdevice_notifiers_info net/core/dev.c:1935 [inline] call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] netdev_wait_allrefs_any net/core/dev.c:10141 [inline] netdev_run_todo+0x97e/0x1140 net/core/dev.c:10253 tun_detach drivers/net/tun.c:696 [inline] tun_chr_close+0x11f/0x130 drivers/net/tun.c:3445 __fput+0x3f6/0x860 fs/file_table.c:317 task_work_run+0x146/0x1c0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:37 [inline] do_exit+0x5e3/0x20c0 kernel/exit.c:795 do_group_exit+0x2af/0x2b0 kernel/exit.c:925 get_signal+0x23bd/0x23c0 kernel/signal.c:2864 arch_do_signal_or_restart+0x8e/0x740 arch/x86/kernel/signal.c:867 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x128/0x1f0 kernel/entry/common.c:201 irqentry_exit_to_user_mode+0x6/0x40 kernel/entry/common.c:307 exc_page_fault+0xe8/0x1e0 arch/x86/mm/fault.c:1543 asm_exc_page_fault+0x1e/0x30 RIP: 0033:0x7f7559288fa6 Code: Unable to access opcode bytes at RIP 0x7f7559288f7c. RSP: 002b:00007f755a3ba0f0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00007f755939bf60 RCX: 00007f7559289049 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000000249f0 RBP: 00007f75592e308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffd1fb1da4f R14: 00007f755a3ba300 R15: 0000000000022000 Allocated by task 3618: 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:436 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:749 [inline] slab_alloc_node mm/slub.c:3217 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc+0x1c9/0x310 mm/slub.c:3242 kmem_cache_zalloc include/linux/slab.h:704 [inline] net_alloc net/core/net_namespace.c:403 [inline] copy_net_ns+0x13c/0x5c0 net/core/net_namespace.c:458 create_new_namespaces+0x4ce/0xa00 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x180 kernel/nsproxy.c:226 ksys_unshare+0x57d/0xb50 kernel/fork.c:3132 __do_sys_unshare kernel/fork.c:3203 [inline] __se_sys_unshare kernel/fork.c:3201 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3201 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x50 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 12979: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x136/0x1e0 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1754 slab_free mm/slub.c:3510 [inline] kmem_cache_free+0xc6/0x2d0 mm/slub.c:3527 net_free net/core/net_namespace.c:432 [inline] cleanup_net+0xba0/0xc70 net/core/net_namespace.c:615 process_one_work+0x83c/0x11a0 kernel/workqueue.c:2289 worker_thread+0xa6c/0x1290 kernel/workqueue.c:2436 kthread+0x2a3/0x2d0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0x97a/0xcc0 kernel/workqueue.c:1517 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1461 [inline] __run_timers+0x752/0x910 kernel/time/timer.c:1734 __do_softirq+0x392/0x7a3 kernel/softirq.c:558 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0x97a/0xcc0 kernel/workqueue.c:1517 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1461 [inline] __run_timers+0x752/0x910 kernel/time/timer.c:1734 __do_softirq+0x392/0x7a3 kernel/softirq.c:558 The buggy address belongs to the object at ffff88807632b700 which belongs to the cache net_namespace of size 6784 The buggy address is located 616 bytes inside of 6784-byte region [ffff88807632b700, ffff88807632d180) The buggy address belongs to the physical page: page:ffffea0001d8ca00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888076329b80 pfn:0x76328 head:ffffea0001d8ca00 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff88806e7e9301 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00005ab808 ffffea0001fcd608 ffff888140007500 raw: ffff888076329b80 0000000000040002 00000001ffffffff ffff88806e7e9301 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 3619, tgid 3619 (syz-executor.1), ts 92384054190, free_ts 92381155268 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0x708/0xa80 mm/page_alloc.c:4182 __alloc_pages+0x255/0x580 mm/page_alloc.c:5408 alloc_slab_page+0x70/0xf0 mm/slub.c:1799 allocate_slab+0x5d/0x380 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x40e/0xcc0 mm/slub.c:3005 __slab_alloc mm/slub.c:3092 [inline] slab_alloc_node mm/slub.c:3183 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc+0x276/0x310 mm/slub.c:3242 kmem_cache_zalloc include/linux/slab.h:704 [inline] net_alloc net/core/net_namespace.c:403 [inline] copy_net_ns+0x13c/0x5c0 net/core/net_namespace.c:458 create_new_namespaces+0x4ce/0xa00 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x180 kernel/nsproxy.c:226 ksys_unshare+0x57d/0xb50 kernel/fork.c:3132 __do_sys_unshare kernel/fork.c:3203 [inline] __se_sys_unshare kernel/fork.c:3201 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3201 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x50 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0xcfc/0xe70 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3423 free_large_kmalloc mm/slub.c:3549 [inline] kfree+0x247/0x390 mm/slub.c:4548 skb_free_head net/core/skbuff.c:655 [inline] skb_release_data+0x48e/0x610 net/core/skbuff.c:677 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb+0x56/0x1d0 net/core/skbuff.c:756 skb_free_datagram+0x27/0x1e0 net/core/datagram.c:325 netlink_recvmsg+0x63a/0x11c0 net/netlink/af_netlink.c:2000 sock_recvmsg_nosec net/socket.c:948 [inline] sock_recvmsg net/socket.c:966 [inline] ____sys_recvmsg+0x2b0/0x5e0 net/socket.c:2632 ___sys_recvmsg net/socket.c:2674 [inline] __sys_recvmsg+0x348/0x8b0 net/socket.c:2704 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x50 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88807632b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807632b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807632b900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807632b980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807632ba00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================