loop2: detected capacity change from 0 to 32768 BTRFS: device fsid 24c7a497-3402-47dd-bef8-82358f5f30e0 devid 1 transid 8 /dev/loop2 scanned by syz-executor.2 (6601) ================================================================== BUG: KASAN: use-after-free in btrfs_test_super+0x5b/0x90 fs/btrfs/super.c:1348 Read of size 8 at addr ffff88807c0fd110 by task syz-executor.2/6601 CPU: 1 PID: 6601 Comm: syz-executor.2 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 btrfs_test_super+0x5b/0x90 fs/btrfs/super.c:1348 sget+0x127/0x4d0 fs/super.c:861 btrfs_mount_root+0x5ec/0x910 fs/btrfs/super.c:1508 legacy_get_tree+0xef/0x190 fs/fs_context.c:638 vfs_get_tree+0x8c/0x280 fs/super.c:1711 fc_mount fs/namespace.c:1112 [inline] vfs_kern_mount+0xbc/0x150 fs/namespace.c:1142 btrfs_mount+0x39f/0xb50 fs/btrfs/super.c:1585 legacy_get_tree+0xef/0x190 fs/fs_context.c:638 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:0x7f0f74a7e1ea 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:00007f0f757ebee8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f0f757ebf80 RCX: 00007f0f74a7e1ea RDX: 0000000020005100 RSI: 0000000020000000 RDI: 00007f0f757ebf40 RBP: 0000000020005100 R08: 00007f0f757ebf80 R09: 0000000000000080 R10: 0000000000000080 R11: 0000000000000202 R12: 0000000020000000 R13: 00007f0f757ebf40 R14: 00000000000050ef R15: 0000000020000040 The buggy address belongs to the physical page: page:ffffea0001f03f40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x4 pfn:0x7c0fd flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 ffffffff00000201 0000000000000000 raw: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0x152dc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_ZERO), pid 6537, tgid 6530 (syz-executor.4), ts 1935351598049, free_ts 1936570828840 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_pages_node include/linux/gfp.h:237 [inline] alloc_pages_node include/linux/gfp.h:260 [inline] __kmalloc_large_node+0x91/0x1d0 mm/slab_common.c:1126 __do_kmalloc_node mm/slab_common.c:973 [inline] __kmalloc_node+0x116/0x230 mm/slab_common.c:992 kmalloc_node include/linux/slab.h:602 [inline] kvmalloc_node+0x72/0x180 mm/util.c:604 kvmalloc include/linux/slab.h:720 [inline] kvzalloc include/linux/slab.h:728 [inline] btrfs_mount_root+0x135/0x910 fs/btrfs/super.c:1466 legacy_get_tree+0xef/0x190 fs/fs_context.c:638 vfs_get_tree+0x8c/0x280 fs/super.c:1711 fc_mount fs/namespace.c:1112 [inline] vfs_kern_mount+0xbc/0x150 fs/namespace.c:1142 btrfs_mount+0x39f/0xb50 fs/btrfs/super.c:1585 legacy_get_tree+0xef/0x190 fs/fs_context.c:638 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 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 free_large_kmalloc+0xff/0x190 mm/slab_common.c:962 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 Memory state around the buggy address: ffff88807c0fd000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807c0fd080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88807c0fd100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807c0fd180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807c0fd200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================