================================================================== 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+0x76/0x90 fs/fuse/inode.c:1665 Read of size 8 at addr ffff8880220a2000 by task syz-executor.5/19852 CPU: 1 PID: 19852 Comm: syz-executor.5 Not tainted 6.5.0-syzkaller-01207-g1c59d383390f #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+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 get_fuse_conn_super fs/fuse/fuse_i.h:874 [inline] fuse_test_super+0x76/0x90 fs/fuse/inode.c:1665 sget_fc+0x145/0x750 fs/super.c:778 fuse_get_tree+0x2fd/0x4b0 fs/fuse/inode.c:1714 vfs_get_tree+0x8c/0x280 fs/super.c:1711 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7eff9147e1ea 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:00007eff920f5ee8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007eff920f5f80 RCX: 00007eff9147e1ea RDX: 0000000020000000 RSI: 0000000020000040 RDI: 0000000000000000 RBP: 0000000020000000 R08: 00007eff920f5f80 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000020000040 R13: 00007eff920f5f40 R14: 0000000000000000 R15: 00000000200020c0 Allocated by task 19851: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] fuse_get_tree+0xb8/0x4b0 fs/fuse/inode.c:1681 vfs_get_tree+0x8c/0x280 fs/super.c:1711 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 19851: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook mm/slub.c:1818 [inline] slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0x25f/0x3b0 mm/slub.c:3814 deactivate_locked_super+0xa5/0x200 fs/super.c:454 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1254 task_work_run+0x24a/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880220a2000 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of freed 32-byte region [ffff8880220a2000, ffff8880220a2020) The buggy address belongs to the physical page: page:ffffea0000882880 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x220a2 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff888012841500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000400040 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 7636720909, free_ts 7633279326 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x31e8/0x3370 mm/page_alloc.c:3221 __alloc_pages+0x255/0x670 mm/page_alloc.c:4477 alloc_page_interleave+0x22/0x1d0 mm/mempolicy.c:2131 alloc_slab_page+0x6a/0x160 mm/slub.c:1862 allocate_slab mm/slub.c:2009 [inline] new_slab+0x84/0x2f0 mm/slub.c:2062 ___slab_alloc+0xade/0x1100 mm/slub.c:3215 __slab_alloc mm/slub.c:3314 [inline] __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc+0xa8/0x230 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:703 [inline] kobject_get_path+0xb8/0x230 lib/kobject.c:154 kobject_uevent_env+0x29f/0x8e0 lib/kobject_uevent.c:529 really_probe+0x7e8/0xc30 drivers/base/dd.c:706 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:798 driver_probe_device+0x50/0x420 drivers/base/dd.c:828 __device_attach_driver+0x2d3/0x520 drivers/base/dd.c:956 bus_for_each_drv+0x24a/0x2d0 drivers/base/bus.c:457 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+0x903/0xa30 mm/page_alloc.c:2348 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2443 vfree+0x186/0x2e0 mm/vmalloc.c:2842 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:2763 process_one_work+0x92c/0x12c0 kernel/workqueue.c:2600 worker_thread+0xa63/0x1210 kernel/workqueue.c:2751 kthread+0x2b8/0x350 kernel/kthread.c:389 ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff8880220a1f00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff8880220a1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880220a2000: fa fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc ^ ffff8880220a2080: 00 00 00 07 fc fc fc fc 00 00 00 00 fc fc fc fc ffff8880220a2100: 00 00 00 01 fc fc fc fc 00 00 00 00 fc fc fc fc ==================================================================