loop0: detected capacity change from 0 to 1024 ======================================================= WARNING: The mand mount option has been deprecated and and is ignored by this kernel. Remove the mand option from the mount to silence this warning. ======================================================= EXT4-fs: Ignoring removed oldalloc option EXT4-fs: Ignoring removed orlov option EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:841 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:956 Read of size 4 at addr ffff8880530c3458 by task syz.0.0/5361 CPU: 0 UID: 0 PID: 5361 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 ext4_ext_binsearch fs/ext4/extents.c:841 [inline] ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:956 ext4_ext_map_blocks+0x288/0x6ac0 fs/ext4/extents.c:4208 ext4_map_create_blocks fs/ext4/inode.c:609 [inline] ext4_map_blocks+0x860/0x1740 fs/ext4/inode.c:811 _ext4_get_block+0x200/0x4c0 fs/ext4/inode.c:910 ext4_get_block_unwritten+0x2e/0x100 fs/ext4/inode.c:943 ext4_block_write_begin+0x993/0x1710 fs/ext4/inode.c:1198 ext4_block_page_mkwrite fs/ext4/inode.c:6664 [inline] ext4_page_mkwrite+0x760/0x1190 fs/ext4/inode.c:6767 do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 wp_page_shared mm/memory.c:3762 [inline] do_wp_page+0x268d/0x5800 mm/memory.c:3981 handle_pte_fault mm/memory.c:6068 [inline] __handle_mm_fault+0x1033/0x5440 mm/memory.c:6195 handle_mm_fault+0x40a/0x8e0 mm/memory.c:6364 do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0010:rep_movs_alternative+0x4a/0x90 arch/x86/lib/copy_user_64.S:74 Code: 09 04 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 8b 06 48 89 07 48 83 c6 08 48 83 c7 08 83 e9 08 74 db 83 f9 08 73 e8 eb c5 a4 c3 cc cc cc cc 48 8b 06 48 89 07 48 8d 47 08 48 83 e0 f8 48 RSP: 0018:ffffc9000d3efb98 EFLAGS: 00050202 RAX: ffffffff84c9a501 RBX: 0000000000000841 RCX: 0000000000000781 RDX: 0000000000000000 RSI: ffff8880548000c0 RDI: 0000200000001000 RBP: ffff888054800000 R08: ffff888054800840 R09: 1ffff1100a900108 R10: dffffc0000000000 R11: ffffed100a900109 R12: 0000200000001781 R13: 00007ffffffff000 R14: ffff888054800000 R15: 0000200000000f40 copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:147 [inline] _inline_copy_to_user include/linux/uaccess.h:197 [inline] _copy_to_user+0x8a/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] do_getxattr+0x22a/0x320 fs/xattr.c:789 filename_getxattr+0x111/0x210 fs/xattr.c:817 path_getxattrat fs/xattr.c:859 [inline] __do_sys_lgetxattr fs/xattr.c:897 [inline] __se_sys_lgetxattr fs/xattr.c:894 [inline] __x64_sys_lgetxattr+0x1c6/0x210 fs/xattr.c:894 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fce57d8ebe9 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:00007fce58b10038 EFLAGS: 00000246 ORIG_RAX: 00000000000000c0 RAX: ffffffffffffffda RBX: 00007fce57fb5fa0 RCX: 00007fce57d8ebe9 RDX: 0000200000000f40 RSI: 0000200000000280 RDI: 0000200000000240 RBP: 00007fce57e11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffff92 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fce57fb6038 R14: 00007fce57fb5fa0 R15: 00007fffd5768978 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x7fce4bd40 pfn:0x530c3 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea00014c3088 ffffea00014c3108 0000000000000000 raw: 00000007fce4bd40 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|__GFP_COMP), pid 5362, tgid 5360 (syz.0.0), ts 91690461126, free_ts 92008943712 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 folio_alloc_mpol_noprof mm/mempolicy.c:2435 [inline] vma_alloc_folio_noprof+0xe4/0x200 mm/mempolicy.c:2470 folio_prealloc+0x30/0x180 mm/memory.c:-1 wp_page_copy mm/memory.c:3552 [inline] do_wp_page+0x1231/0x5800 mm/memory.c:4013 handle_pte_fault mm/memory.c:6068 [inline] __handle_mm_fault+0x1033/0x5440 mm/memory.c:6195 handle_mm_fault+0x40a/0x8e0 mm/memory.c:6364 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1336 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 5362 tgid 5360 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] free_unref_folios+0xdbd/0x1520 mm/page_alloc.c:2952 folios_put_refs+0x559/0x640 mm/swap.c:997 free_pages_and_swap_cache+0x4be/0x520 mm/swap_state.c:267 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:397 [inline] tlb_flush_mmu+0x3a0/0x680 mm/mmu_gather.c:404 tlb_finish_mmu+0xc3/0x1d0 mm/mmu_gather.c:497 vms_clear_ptes+0x42c/0x540 mm/vma.c:1235 vms_complete_munmap_vmas+0x206/0x8a0 mm/vma.c:1277 do_vmi_align_munmap+0x358/0x420 mm/vma.c:1536 do_vmi_munmap+0x253/0x2e0 mm/vma.c:1584 __vm_munmap+0x23b/0x3d0 mm/vma.c:3155 __do_sys_munmap mm/mmap.c:1080 [inline] __se_sys_munmap mm/mmap.c:1077 [inline] __x64_sys_munmap+0x60/0x70 mm/mmap.c:1077 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880530c3300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880530c3380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880530c3400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880530c3480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880530c3500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess): 0: 09 04 00 or %eax,(%rax,%rax,1) 3: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) a: 00 00 00 d: 0f 1f 00 nopl (%rax) 10: 48 8b 06 mov (%rsi),%rax 13: 48 89 07 mov %rax,(%rdi) 16: 48 83 c6 08 add $0x8,%rsi 1a: 48 83 c7 08 add $0x8,%rdi 1e: 83 e9 08 sub $0x8,%ecx 21: 74 db je 0xfffffffe 23: 83 f9 08 cmp $0x8,%ecx 26: 73 e8 jae 0x10 28: eb c5 jmp 0xffffffef * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: c3 ret 2d: cc int3 2e: cc int3 2f: cc int3 30: cc int3 31: 48 8b 06 mov (%rsi),%rax 34: 48 89 07 mov %rax,(%rdi) 37: 48 8d 47 08 lea 0x8(%rdi),%rax 3b: 48 83 e0 f8 and $0xfffffffffffffff8,%rax 3f: 48 rex.W