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 list_add include/linux/list.h:169 [inline] BUG: KASAN: slab-use-after-free in rhashtable_walk_enter+0x333/0x370 lib/rhashtable.c:684 Read of size 8 at addr ffff888025826010 by task syz.3.375/7384 CPU: 0 UID: 0 PID: 7384 Comm: syz.3.375 Not tainted 6.12.0-rc1-syzkaller-00381-g2a130b7e1fcd #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 list_add include/linux/list.h:169 [inline] rhashtable_walk_enter+0x333/0x370 lib/rhashtable.c:684 rhltable_walk_enter include/linux/rhashtable.h:1262 [inline] __nfsd_file_cache_purge+0xad/0x470 fs/nfsd/filecache.c:837 nfsd_file_cache_shutdown+0xcf/0x4e0 fs/nfsd/filecache.c:929 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:0x7f86cf37dff9 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:00007f86d0266038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f86cf535f80 RCX: 00007f86cf37dff9 RDX: 0000000000008004 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 00007f86cf3f0296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f86cf535f80 R15: 00007ffdb71ec208 Allocated by task 5943: 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] tomoyo_realpath_from_path+0xbf/0x710 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x273/0x480 security/tomoyo/file.c:822 security_inode_getattr+0x116/0x290 security/security.c:2371 vfs_getattr+0x36/0xb0 fs/stat.c:204 vfs_statx_path+0x36/0x390 fs/stat.c:251 vfs_statx+0x145/0x1e0 fs/stat.c:315 vfs_fstatat+0x9f/0x160 fs/stat.c:341 __do_sys_newfstatat+0xa2/0x130 fs/stat.c:505 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 5943: 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 tomoyo_realpath_from_path+0x1b7/0x710 security/tomoyo/realpath.c:286 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x273/0x480 security/tomoyo/file.c:822 security_inode_getattr+0x116/0x290 security/security.c:2371 vfs_getattr+0x36/0xb0 fs/stat.c:204 vfs_statx_path+0x36/0x390 fs/stat.c:251 vfs_statx+0x145/0x1e0 fs/stat.c:315 vfs_fstatat+0x9f/0x160 fs/stat.c:341 __do_sys_newfstatat+0xa2/0x130 fs/stat.c:505 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 ffff888025826000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 16 bytes inside of freed 4096-byte region [ffff888025826000, ffff888025827000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25820 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801ac42140 ffffea0001f2d800 dead000000000002 raw: 0000000000000000 0000000000040004 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801ac42140 ffffea0001f2d800 dead000000000002 head: 0000000000000000 0000000000040004 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea0000960801 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 8910173719, free_ts 0 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_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2ba/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] __kmalloc_cache_node_noprof+0xf1/0x360 mm/slub.c:4303 kmalloc_node_noprof include/linux/slab.h:901 [inline] bdi_alloc+0x44/0x170 mm/backing-dev.c:1021 __alloc_disk_node+0xa9/0x610 block/genhd.c:1349 __blk_alloc_disk+0xe2/0x180 block/genhd.c:1408 zram_add+0x169/0x670 drivers/block/zram/zram_drv.c:2369 zram_init+0x12c/0x270 drivers/block/zram/zram_drv.c:2570 do_one_initcall+0x128/0x630 init/main.c:1269 do_initcall_level init/main.c:1331 [inline] do_initcalls init/main.c:1347 [inline] do_basic_setup init/main.c:1366 [inline] kernel_init_freeable+0x58f/0x8b0 init/main.c:1580 kernel_init+0x1c/0x2b0 init/main.c:1469 page_owner free stack trace missing Memory state around the buggy address: ffff888025825f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888025825f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888025826000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888025826080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888025826100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================