svc: failed to register nfsdv3 RPC service (errno 512). svc: failed to register nfsaclv3 RPC service (errno 512). ================================================================== BUG: KASAN: slab-use-after-free in shrinker_free+0x3b7/0x430 mm/shrinker.c:775 Read of size 4 at addr ffff88807cd13f1c by task syz.0.89/5627 CPU: 0 UID: 0 PID: 5627 Comm: syz.0.89 Not tainted 6.11.0-syzkaller-11624-ge477dba5442c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 shrinker_free+0x3b7/0x430 mm/shrinker.c:775 nfsd_file_cache_shutdown+0xbc/0x4e0 fs/nfsd/filecache.c:923 nfsd_shutdown_generic fs/nfsd/nfssvc.c:314 [inline] nfsd_shutdown_generic fs/nfsd/nfssvc.c:308 [inline] nfsd_startup_net fs/nfsd/nfssvc.c:429 [inline] nfsd_svc+0x6a9/0x940 fs/nfsd/nfssvc.c:820 nfsd_nl_threads_set_doit+0x535/0xbe0 fs/nfsd/nfsctl.c:1722 genl_family_rcv_msg_doit+0x202/0x2f0 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2550 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg net/socket.c:744 [inline] ____sys_sendmsg+0x9ae/0xb40 net/socket.c:2602 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2656 __sys_sendmsg+0x117/0x1f0 net/socket.c:2685 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6ba9b7dff9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6baa93b038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f6ba9d36058 RCX: 00007f6ba9b7dff9 RDX: 0000000000008004 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 00007f6ba9bf0296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f6ba9d36058 R15: 00007ffdf4427d88 Allocated by task 5614: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] shrinker_alloc+0xf8/0xb00 mm/shrinker.c:683 nfsd_file_cache_init+0x1cb/0x4d0 fs/nfsd/filecache.c:775 nfsd_startup_generic fs/nfsd/nfssvc.c:292 [inline] nfsd_startup_net fs/nfsd/nfssvc.c:387 [inline] nfsd_svc+0x5db/0x940 fs/nfsd/nfssvc.c:820 nfsd_nl_threads_set_doit+0x535/0xbe0 fs/nfsd/nfsctl.c:1722 genl_family_rcv_msg_doit+0x202/0x2f0 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2550 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg net/socket.c:744 [inline] ____sys_sendmsg+0x9ae/0xb40 net/socket.c:2602 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2656 __sys_sendmsg+0x117/0x1f0 net/socket.c:2685 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5622: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2343 [inline] slab_free mm/slub.c:4580 [inline] kfree+0x14f/0x4b0 mm/slub.c:4728 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0x79d/0x14d0 kernel/rcu/tree.c:2823 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1037 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x99/0x7a0 kernel/rcu/tree.c:3086 shrinker_free+0xfe/0x430 mm/shrinker.c:807 nfsd_file_cache_shutdown+0xbc/0x4e0 fs/nfsd/filecache.c:923 nfsd_shutdown_generic fs/nfsd/nfssvc.c:314 [inline] nfsd_shutdown_generic fs/nfsd/nfssvc.c:308 [inline] nfsd_startup_net fs/nfsd/nfssvc.c:429 [inline] nfsd_svc+0x6a9/0x940 fs/nfsd/nfssvc.c:820 nfsd_nl_threads_set_doit+0x535/0xbe0 fs/nfsd/nfsctl.c:1722 genl_family_rcv_msg_doit+0x202/0x2f0 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2550 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg net/socket.c:744 [inline] ____sys_sendmsg+0x9ae/0xb40 net/socket.c:2602 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2656 __sys_sendmsg+0x117/0x1f0 net/socket.c:2685 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88807cd13f00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 28 bytes inside of freed 192-byte region [ffff88807cd13f00, ffff88807cd13fc0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7cd13 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801ac413c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000001f5000000 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5313, tgid 5310 (syz.1.11), ts 59322903175, free_ts 59250964777 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x101e/0x3070 mm/page_alloc.c:3457 __alloc_pages_noprof+0x223/0x25c0 mm/page_alloc.c:4733 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_slab_page mm/slub.c:2415 [inline] allocate_slab mm/slub.c:2579 [inline] new_slab+0xca/0x3f0 mm/slub.c:2632 ___slab_alloc+0xc15/0x1500 mm/slub.c:3819 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3909 __slab_alloc_node mm/slub.c:3962 [inline] slab_alloc_node mm/slub.c:4123 [inline] __do_kmalloc_node mm/slub.c:4264 [inline] __kmalloc_node_noprof+0x367/0x440 mm/slub.c:4271 kmalloc_array_node_noprof include/linux/slab.h:995 [inline] alloc_slab_obj_exts+0x41/0xa0 mm/slub.c:1969 account_slab mm/slub.c:2542 [inline] allocate_slab mm/slub.c:2597 [inline] new_slab+0x305/0x3f0 mm/slub.c:2632 ___slab_alloc+0xc15/0x1500 mm/slub.c:3819 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3909 __slab_alloc_node mm/slub.c:3962 [inline] slab_alloc_node mm/slub.c:4123 [inline] kmem_cache_alloc_noprof+0x2ae/0x2f0 mm/slub.c:4142 sk_prot_alloc+0x60/0x2a0 net/core/sock.c:2158 sk_alloc+0x36/0xb90 net/core/sock.c:2217 inet6_create net/ipv6/af_inet6.c:193 [inline] inet6_create+0x380/0x12e0 net/ipv6/af_inet6.c:120 __sock_create+0x32e/0x800 net/socket.c:1576 page last free pid 5307 tgid 5305 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_folios+0x956/0x1310 mm/page_alloc.c:2686 folios_put_refs+0x551/0x750 mm/swap.c:1007 free_pages_and_swap_cache+0x45f/0x510 mm/swap_state.c:335 __tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu mm/mmu_gather.c:373 [inline] tlb_finish_mmu+0x168/0x7b0 mm/mmu_gather.c:465 exit_mmap+0x3df/0xb30 mm/mmap.c:1877 __mmput+0x12a/0x480 kernel/fork.c:1347 mmput+0x62/0x70 kernel/fork.c:1369 exit_mm kernel/exit.c:571 [inline] do_exit+0x9bf/0x2ce0 kernel/exit.c:926 do_group_exit+0xd3/0x2a0 kernel/exit.c:1088 get_signal+0x2658/0x26d0 kernel/signal.c:2917 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807cd13e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807cd13e80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88807cd13f00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807cd13f80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88807cd14000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================