================================================================== BUG: KASAN: use-after-free in nexthop_flush_dev+0x20b/0x230 net/ipv4/nexthop.c:2382 Read of size 8 at addr ffff888017d6a058 by task syz-executor.4/3672 CPU: 1 PID: 3672 Comm: syz-executor.4 Not tainted 6.1.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 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+0xbf/0x1f0 mm/kasan/report.c:495 nexthop_flush_dev+0x20b/0x230 net/ipv4/nexthop.c:2382 nh_netdev_event+0x2ca/0x370 net/ipv4/nexthop.c:3575 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1945 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+0xbc6/0x1100 net/core/dev.c:10351 tun_detach drivers/net/tun.c:704 [inline] tun_chr_close+0xe4/0x190 drivers/net/tun.c:3467 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xb3d/0x2a30 kernel/exit.c:820 do_group_exit+0xd4/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+0x3e/0x50 kernel/exit.c:959 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ff0aba8b639 Code: Unable to access opcode bytes at 0x7ff0aba8b60f. RSP: 002b:00007ffcdb5f3358 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007ffcdb5f3500 RCX: 00007ff0aba8b639 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 0000000000000000 R08: 0000000000000025 R09: 00007ffcdb5f3500 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff0abae6aba R13: 000000000000001c R14: 000000000000000d R15: 00007ffcdb5f3540 Allocated by task 3672: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] nexthop_net_init+0x75/0x140 net/ipv4/nexthop.c:3754 ops_init+0xb9/0x680 net/core/net_namespace.c:135 setup_net+0x5d1/0xc50 net/core/net_namespace.c:332 copy_net_ns+0x31c/0x760 net/core/net_namespace.c:478 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x449/0x920 kernel/fork.c:3188 __do_sys_unshare kernel/fork.c:3259 [inline] __se_sys_unshare kernel/fork.c:3257 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3257 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 3758: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/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+0xaf/0x3b0 mm/slub.c:3674 nexthop_net_exit_batch+0x249/0x2e0 net/ipv4/nexthop.c:3744 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 cleanup_net+0x4ee/0xb00 net/core/net_namespace.c:601 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/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+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 call_rcu+0x9d/0x820 kernel/rcu/tree.c:2798 netlink_release+0xf0f/0x1dd0 net/netlink/af_netlink.c:815 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x1c/0x20 net/socket.c:1365 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888017d6a000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 88 bytes inside of 2048-byte region [ffff888017d6a000, ffff888017d6a800) The buggy address belongs to the physical page: page:ffffea00005f5a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x17d68 head:ffffea00005f5a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00005fae00 dead000000000002 ffff888012042000 raw: 0000000000000000 0000000000080008 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 1, tgid 1 (swapper/0), ts 2426317916, free_ts 0 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4288 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5555 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2118 alloc_pages+0x233/0x270 mm/mempolicy.c:2280 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] __kmem_cache_alloc_node+0x199/0x3e0 mm/slub.c:3437 kmalloc_trace+0x26/0x60 mm/slab_common.c:1045 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] acpi_os_allocate_zeroed include/acpi/platform/aclinuxex.h:57 [inline] acpi_ds_create_walk_state+0x8c/0x203 drivers/acpi/acpica/dswstate.c:518 acpi_ds_execute_arguments+0x1c9/0x27c drivers/acpi/acpica/dsargs.c:107 acpi_ds_get_package_arguments+0x112/0x128 drivers/acpi/acpica/dsargs.c:312 acpi_ns_init_one_package+0x7d/0xf6 drivers/acpi/acpica/nsinit.c:279 acpi_ns_init_one_object+0x284/0x336 drivers/acpi/acpica/nsinit.c:403 acpi_ns_walk_namespace+0x250/0x432 drivers/acpi/acpica/nswalk.c:240 acpi_walk_namespace drivers/acpi/acpica/nsxfeval.c:606 [inline] acpi_walk_namespace+0xf2/0x12b drivers/acpi/acpica/nsxfeval.c:554 page_owner free stack trace missing Memory state around the buggy address: ffff888017d69f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888017d69f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888017d6a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888017d6a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888017d6a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================