svc: failed to register nfsdv3 RPC service (errno 111). svc: failed to register nfsaclv3 RPC service (errno 111). ================================================================== BUG: KASAN: slab-use-after-free in shrinker_free+0x3b7/0x430 mm/shrinker.c:775 Read of size 4 at addr ffff88806c16221c by task syz.0.1084/10860 CPU: 1 UID: 0 PID: 10860 Comm: syz.0.1084 Not tainted 6.12.0-rc2-syzkaller-00006-g87d6aab2389e #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:0x7fbc9457dff9 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:00007fbc93fff038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fbc94736058 RCX: 00007fbc9457dff9 RDX: 0000000000008004 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 00007fbc945f0296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fbc94736058 R15: 00007ffe85c44f78 Allocated by task 10136: 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 kasan_kmalloc include/linux/kasan.h:257 [inline] __do_kmalloc_node mm/slub.c:4264 [inline] __kmalloc_noprof+0x1e8/0x410 mm/slub.c:4276 kmalloc_noprof include/linux/slab.h:882 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] ops_init+0x77/0x5f0 net/core/net_namespace.c:129 setup_net+0x21f/0x860 net/core/net_namespace.c:356 copy_net_ns+0x2b4/0x6b0 net/core/net_namespace.c:494 create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x45d/0xa40 kernel/fork.c:3311 __do_sys_unshare kernel/fork.c:3382 [inline] __se_sys_unshare kernel/fork.c:3380 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3380 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 11: 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:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x14f/0x4b0 mm/slub.c:4727 ops_free_list+0x14e/0x410 net/core/net_namespace.c:188 cleanup_net+0x60a/0xb40 net/core/net_namespace.c:630 process_one_work+0x958/0x1b30 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88806c162200 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 28 bytes inside of freed 192-byte region [ffff88806c162200, ffff88806c1622c0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88806c162a00 pfn:0x6c162 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff88801ac413c0 ffffea0001971c50 ffffea000090dd90 raw: ffff88806c162a00 0000000000100004 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 4686, tgid 4686 (udevd), ts 422105854038, free_ts 422102455057 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:2414 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0xca/0x3f0 mm/slub.c:2631 ___slab_alloc+0xd1d/0x16f0 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_node_noprof+0x367/0x440 mm/slub.c:4270 kmalloc_array_node_noprof include/linux/slab.h:995 [inline] alloc_slab_obj_exts+0x41/0xa0 mm/slub.c:1968 account_slab mm/slub.c:2541 [inline] allocate_slab mm/slub.c:2596 [inline] new_slab+0x305/0x3f0 mm/slub.c:2631 ___slab_alloc+0xd1d/0x16f0 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2ae/0x2f0 mm/slub.c:4141 alloc_empty_file+0x73/0x1e0 fs/file_table.c:209 path_openat+0xe1/0x2d60 fs/namei.c:3919 do_filp_open+0x1dc/0x430 fs/namei.c:3960 do_sys_openat2+0x17a/0x1e0 fs/open.c:1415 page last free pid 4675 tgid 4675 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2638 __put_partials+0x14c/0x170 mm/slub.c:3145 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 __alloc_skb+0x2b3/0x380 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1322 [inline] alloc_skb_with_frags+0xe4/0x850 net/core/skbuff.c:6612 sock_alloc_send_pskb+0x7f1/0x980 net/core/sock.c:2883 unix_dgram_sendmsg+0x46c/0x1940 net/unix/af_unix.c:2027 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg net/socket.c:744 [inline] __sys_sendto+0x479/0x4d0 net/socket.c:2209 __do_sys_sendto net/socket.c:2221 [inline] __se_sys_sendto net/socket.c:2217 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2217 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 Memory state around the buggy address: ffff88806c162100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806c162180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88806c162200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806c162280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88806c162300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================