================================================================== BUG: KASAN: use-after-free in do_shrink_slab+0xbe6/0xce0 mm/vmscan.c:785 Read of size 8 at addr ffff8880236c25b8 by task syz-fuzzer/4299 CPU: 2 PID: 4299 Comm: syz-fuzzer Not tainted 6.1.0-rc1-syzkaller-00025-gaae703b02f92 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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/0x461 mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 do_shrink_slab+0xbe6/0xce0 mm/vmscan.c:785 shrink_slab+0x175/0x660 mm/vmscan.c:1002 shrink_node_memcgs mm/vmscan.c:6076 [inline] shrink_node+0x93d/0x1f30 mm/vmscan.c:6105 shrink_zones mm/vmscan.c:6343 [inline] do_try_to_free_pages+0x3b4/0x17a0 mm/vmscan.c:6405 try_to_free_pages+0x2e1/0x960 mm/vmscan.c:6640 __perform_reclaim mm/page_alloc.c:4754 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:4776 [inline] __alloc_pages_slowpath.constprop.0+0x8b6/0x23d0 mm/page_alloc.c:5182 __alloc_pages+0x4a6/0x5a0 mm/page_alloc.c:5567 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 folio_alloc+0x1c/0x70 mm/mempolicy.c:2290 filemap_alloc_folio+0x306/0x3a0 mm/filemap.c:971 page_cache_ra_unbounded+0x1aa/0x5e0 mm/readahead.c:248 do_page_cache_ra mm/readahead.c:300 [inline] page_cache_ra_order+0x6e8/0xa00 mm/readahead.c:560 do_sync_mmap_readahead mm/filemap.c:3043 [inline] filemap_fault+0x153b/0x2400 mm/filemap.c:3135 __do_fault+0x107/0x600 mm/memory.c:4203 do_read_fault mm/memory.c:4554 [inline] do_fault mm/memory.c:4683 [inline] handle_pte_fault mm/memory.c:4955 [inline] __handle_mm_fault+0x2184/0x3a40 mm/memory.c:5097 handle_mm_fault+0x1c8/0x780 mm/memory.c:5218 do_user_addr_fault+0x475/0x1210 arch/x86/mm/fault.c:1428 handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x94/0x170 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x452c5c Code: Unable to access opcode bytes at 0x452c32. RSP: 002b:000000c002589778 EFLAGS: 00010206 RAX: 0000000000e1717a RBX: 00000000000ea68e RCX: 00000000000ea68e RDX: 00000000000ea68e RSI: 000000c0025897cc RDI: 000000c0025897d8 RBP: 000000c002589788 R08: 0000000000000000 R09: 0000000000e1717a R10: 000000000053b0e6 R11: 00000000000394d6 R12: 000000000053b0e6 R13: 00000000000ea68e R14: 000000c00028f6c0 R15: 00007f8b48ba1084 Allocated by task 5967: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0x9f/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0x54/0xc0 mm/slab_common.c:968 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:712 [inline] ops_init+0xfb/0x470 net/core/net_namespace.c:124 setup_net+0x5d1/0xc50 net/core/net_namespace.c:325 copy_net_ns+0x318/0x760 net/core/net_namespace.c:471 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 copy_namespaces+0x391/0x450 kernel/nsproxy.c:178 copy_process+0x306e/0x7190 kernel/fork.c:2256 kernel_clone+0xe7/0x980 kernel/fork.c:2671 __do_sys_clone3+0x1cd/0x2e0 kernel/fork.c:2970 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 5967: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] __cache_free mm/slab.c:3389 [inline] __do_kmem_cache_free mm/slab.c:3585 [inline] __kmem_cache_free+0xc9/0x3a0 mm/slab.c:3592 ops_init+0xcd/0x470 net/core/net_namespace.c:139 setup_net+0x5d1/0xc50 net/core/net_namespace.c:325 copy_net_ns+0x318/0x760 net/core/net_namespace.c:471 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 copy_namespaces+0x391/0x450 kernel/nsproxy.c:178 copy_process+0x306e/0x7190 kernel/fork.c:2256 kernel_clone+0xe7/0x980 kernel/fork.c:2671 __do_sys_clone3+0x1cd/0x2e0 kernel/fork.c:2970 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 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:481 call_rcu+0x99/0x820 kernel/rcu/tree.c:2796 netlink_release+0xeff/0x1db0 net/netlink/af_netlink.c:815 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16b/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+0x19/0x50 kernel/entry/common.c:296 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880236c2000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1464 bytes inside of 2048-byte region [ffff8880236c2000, ffff8880236c2800) The buggy address belongs to the physical page: page:ffffea00008db080 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x236c2 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000071f448 ffffea00007b3888 ffff888011840800 raw: 0000000000000000 ffff8880236c2000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2c2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 3774, tgid 3774 (syz-executor.0), ts 258095500363, free_ts 253846426417 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4287 __alloc_pages_slowpath.constprop.0+0x36b/0x23d0 mm/page_alloc.c:5088 __alloc_pages+0x4a6/0x5a0 mm/page_alloc.c:5567 __alloc_pages_node include/linux/gfp.h:223 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2570 cache_alloc_refill+0x27f/0x380 mm/slab.c:2943 ____cache_alloc mm/slab.c:3019 [inline] ____cache_alloc mm/slab.c:3002 [inline] __do_cache_alloc mm/slab.c:3202 [inline] slab_alloc_node mm/slab.c:3250 [inline] __kmem_cache_alloc_node+0x442/0x500 mm/slab.c:3549 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node_track_caller+0x45/0xc0 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1267 [inline] nlmsg_new include/net/netlink.h:964 [inline] inet6_ifinfo_notify+0x72/0x150 net/ipv6/addrconf.c:6047 addrconf_notify+0x4a4/0x1c10 net/ipv6/addrconf.c:3657 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] __dev_notify_flags+0x110/0x2b0 net/core/dev.c:8577 dev_change_flags+0x112/0x170 net/core/dev.c:8615 do_setlink+0x9f1/0x3bb0 net/core/rtnetlink.c:2788 __rtnl_newlink+0xd6a/0x17e0 net/core/rtnetlink.c:3547 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 __vunmap+0x85d/0xd30 mm/vmalloc.c:2713 __vfree+0x3c/0xd0 mm/vmalloc.c:2761 vfree+0x5a/0x90 mm/vmalloc.c:2792 kcov_put kernel/kcov.c:428 [inline] kcov_put+0x26/0x40 kernel/kcov.c:424 kcov_close+0xc/0x10 kernel/kcov.c:524 __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 Memory state around the buggy address: ffff8880236c2480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880236c2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880236c2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880236c2600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880236c2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================