================================================================== BUG: KASAN: slab-use-after-free in get_fuse_conn_super fs/fuse/fuse_i.h:874 [inline] BUG: KASAN: slab-use-after-free in fuse_test_super+0x94/0xa0 fs/fuse/inode.c:1661 Read of size 8 at addr ffff8881072e1800 by task syz-executor.2/4745 CPU: 0 PID: 4745 Comm: syz-executor.2 Not tainted 6.5.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x3d/0x60 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 get_fuse_conn_super fs/fuse/fuse_i.h:874 [inline] fuse_test_super+0x94/0xa0 fs/fuse/inode.c:1661 sget_fc+0x4ee/0x760 fs/super.c:764 fuse_get_tree+0x3bc/0x5a0 fs/fuse/inode.c:1710 vfs_get_tree+0x82/0x220 fs/super.c:1711 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x878/0x1a00 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x208/0x280 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f6542a7e1ea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f654378eee8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f654378ef80 RCX: 00007f6542a7e1ea RDX: 0000000020000280 RSI: 0000000020000300 RDI: 0000000000000000 RBP: 0000000020000280 R08: 00007f654378ef80 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000300 R13: 00007f654378ef40 R14: 0000000000000000 R15: 00000000200028c0 Allocated by task 4751: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] fuse_get_tree+0xb4/0x5a0 fs/fuse/inode.c:1677 vfs_get_tree+0x82/0x220 fs/super.c:1711 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x878/0x1a00 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x208/0x280 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 4751: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15e/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xba/0x340 mm/slub.c:3814 deactivate_locked_super+0x83/0x270 fs/super.c:454 cleanup_mnt+0x1d8/0x360 fs/namespace.c:1254 task_work_run+0x114/0x1f0 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+0x13f/0x150 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x16/0x30 kernel/entry/common.c:297 do_syscall_64+0x44/0x80 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8881072e1800 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of freed 32-byte region [ffff8881072e1800, ffff8881072e1820) The buggy address belongs to the physical page: page:ffffea00041cb840 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1072e1 flags: 0x100000000000200(slab|node=0|zone=2) page_type: 0xffffffff() raw: 0100000000000200 ffff888100041500 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080400040 00000001ffffffff 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 4747, tgid 4743 (syz-executor.1), ts 77126041167, free_ts 76998620858 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x281/0x2f0 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x1131/0x3d90 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x470 mm/page_alloc.c:4477 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x24e/0x360 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x7a7/0x1000 mm/slub.c:3215 __slab_alloc.constprop.0+0x4d/0x90 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x143/0x390 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc+0x4c/0x160 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:703 [inline] tomoyo_encode2+0x9e/0x320 security/tomoyo/realpath.c:45 tomoyo_mount_acl+0x21e/0x7d0 security/tomoyo/mount.c:150 tomoyo_mount_permission+0x114/0x280 security/tomoyo/mount.c:237 security_sb_mount+0x74/0xb0 security/security.c:1360 path_mount+0xe9/0x1a00 fs/namespace.c:3604 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x208/0x280 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x5ac/0xcf0 mm/page_alloc.c:2348 free_unref_page_list+0xe6/0xaa0 mm/page_alloc.c:2489 release_pages+0x25c/0x10c0 mm/swap.c:1042 tlb_batch_pages_flush+0x79/0x140 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x114/0x6c0 mm/mmu_gather.c:391 exit_mmap+0x26a/0x730 mm/mmap.c:3214 __mmput+0xb7/0x3e0 kernel/fork.c:1348 exit_mm kernel/exit.c:567 [inline] do_exit+0x776/0x2650 kernel/exit.c:861 do_group_exit+0xb4/0x250 kernel/exit.c:1024 get_signal+0x1ed5/0x1f00 kernel/signal.c:2877 arch_do_signal_or_restart+0x89/0x5d0 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0xc3/0x150 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x16/0x30 kernel/entry/common.c:297 do_syscall_64+0x44/0x80 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8881072e1700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff8881072e1780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff8881072e1800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff8881072e1880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff8881072e1900: fa fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc ==================================================================