================================================================== BUG: KASAN: use-after-free in notifier_call_chain kernel/notifier.c:75 [inline] BUG: KASAN: use-after-free in raw_notifier_call_chain+0x3e/0x170 kernel/notifier.c:455 Read of size 8 at addr ffff888024c39de8 by task syz-executor.2/12312 CPU: 1 PID: 12312 Comm: syz-executor.2 Not tainted 5.19.0-syzkaller-02972-g200e340f2196 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:313 print_report+0xf4/0x210 mm/kasan/report.c:429 kasan_report+0xfb/0x130 mm/kasan/report.c:491 notifier_call_chain kernel/notifier.c:75 [inline] raw_notifier_call_chain+0x3e/0x170 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:1942 [inline] 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:10231 [inline] netdev_run_todo+0x8ce/0x1090 net/core/dev.c:10345 tun_detach drivers/net/tun.c:704 [inline] tun_chr_close+0x11f/0x130 drivers/net/tun.c:3455 __fput+0x3b9/0x820 fs/file_table.c:319 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x55e/0x20a0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 get_signal+0x172f/0x1780 kernel/signal.c:2857 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:166 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 ret_from_fork+0x15/0x30 RIP: 0033:0x7fbb6d289209 Code: Unable to access opcode bytes at RIP 0x7fbb6d2891df. RSP: 002b:00007fbb6e40b118 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: 0000000000000000 RBX: 00007fbb6d39bf60 RCX: 00007fbb6d289209 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007fbb6d2e3161 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe259d6eef R14: 00007fbb6e40b300 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:437 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:470 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x1a6/0x310 mm/slub.c:3268 kmem_cache_zalloc include/linux/slab.h:723 [inline] net_alloc net/core/net_namespace.c:403 [inline] copy_net_ns+0x13c/0x5b0 net/core/net_namespace.c:458 create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x180 kernel/nsproxy.c:227 ksys_unshare+0x57f/0xb30 kernel/fork.c:3169 __do_sys_unshare kernel/fork.c:3240 [inline] __se_sys_unshare kernel/fork.c:3238 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3238 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0x969/0xc20 kernel/workqueue.c:1517 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers+0x7a2/0x980 kernel/time/timer.c:1790 __do_softirq+0x382/0x793 kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0x969/0xc20 kernel/workqueue.c:1517 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers+0x7a2/0x980 kernel/time/timer.c:1790 __do_softirq+0x382/0x793 kernel/softirq.c:571 The buggy address belongs to the object at ffff888024c39b80 which belongs to the cache net_namespace of size 6784 The buggy address is located 616 bytes inside of 6784-byte region [ffff888024c39b80, ffff888024c3b600) The buggy address belongs to the physical page: page:ffffea0000930e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024c39b80 pfn:0x24c38 head:ffffea0000930e00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00009b1400 dead000000000002 ffff888140007500 raw: ffff888024c39b80 0000000080040003 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 3614, tgid 3614 (syz-executor.0), ts 57241070141, free_ts 40589597248 prep_new_page mm/page_alloc.c:2457 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4203 __alloc_pages+0x259/0x560 mm/page_alloc.c:5431 alloc_slab_page+0x70/0xf0 mm/slub.c:1824 allocate_slab+0x5e/0x520 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3031 __slab_alloc mm/slub.c:3118 [inline] slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x25d/0x310 mm/slub.c:3268 kmem_cache_zalloc include/linux/slab.h:723 [inline] net_alloc net/core/net_namespace.c:403 [inline] copy_net_ns+0x13c/0x5b0 net/core/net_namespace.c:458 create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x180 kernel/nsproxy.c:227 ksys_unshare+0x57f/0xb30 kernel/fork.c:3169 __do_sys_unshare kernel/fork.c:3240 [inline] __se_sys_unshare kernel/fork.c:3238 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3238 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 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:1371 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3344 [inline] free_unref_page+0x7d/0x390 mm/page_alloc.c:3439 free_slab mm/slub.c:2068 [inline] discard_slab mm/slub.c:2074 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2548 put_cpu_partial+0x116/0x180 mm/slub.c:2624 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x1a6/0x310 mm/slub.c:3268 kmem_cache_zalloc include/linux/slab.h:723 [inline] ep_insert+0x263/0x17d0 fs/eventpoll.c:1463 do_epoll_ctl+0x8d5/0xee0 fs/eventpoll.c:2141 __do_sys_epoll_ctl fs/eventpoll.c:2192 [inline] __se_sys_epoll_ctl fs/eventpoll.c:2183 [inline] __x64_sys_epoll_ctl+0x15d/0x1a0 fs/eventpoll.c:2183 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888024c39c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024c39d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888024c39d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888024c39e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024c39e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================