================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:837 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:953 Read of size 4 at addr ffff888130836018 by task syz.2.18/489 CPU: 1 PID: 489 Comm: syz.2.18 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x71/0x200 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:420 kasan_report+0x122/0x150 mm/kasan/report.c:524 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 ext4_ext_binsearch fs/ext4/extents.c:837 [inline] ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:953 ext4_ext_map_blocks+0x207/0x61d0 fs/ext4/extents.c:4166 ext4_map_blocks+0x9d8/0x1b70 fs/ext4/inode.c:679 _ext4_get_block+0x1ea/0x540 fs/ext4/inode.c:822 ext4_get_block_unwritten+0x2e/0x100 fs/ext4/inode.c:855 __block_write_begin_int+0x482/0x1430 fs/buffer.c:2034 __block_write_begin fs/buffer.c:2084 [inline] block_page_mkwrite+0x281/0x300 fs/buffer.c:2558 ext4_page_mkwrite+0x4f8/0x1310 fs/ext4/inode.c:6329 do_page_mkwrite mm/memory.c:3036 [inline] wp_page_shared+0x505/0x8d0 mm/memory.c:3429 do_wp_page+0xde4/0xfc0 mm/memory.c:3581 handle_pte_fault mm/memory.c:5189 [inline] __handle_mm_fault mm/memory.c:5313 [inline] handle_mm_fault+0x1124/0x26c0 mm/memory.c:5453 do_user_addr_fault+0x63b/0x1050 arch/x86/mm/fault.c:1374 handle_page_fault arch/x86/mm/fault.c:1466 [inline] exc_page_fault+0x51/0xb0 arch/x86/mm/fault.c:1522 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0010:copy_user_enhanced_fast_string+0xa/0x40 arch/x86/lib/copy_user_64.S:166 Code: ff c9 75 f2 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 8d 0c ca 89 ca eb 20 0f 01 cb 83 fa 40 72 38 89 d1 a4 31 c0 0f 01 ca c3 89 ca eb 0a 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90000997a48 EFLAGS: 00050246 RAX: ffffffff82683601 RBX: 0000000000000040 RCX: 0000000000000040 RDX: 0000000000000040 RSI: ffffc90000997ae0 RDI: 00002000000c6000 RBP: ffffc90000997a70 R08: ffffc90000997b1f R09: 1ffff92000132f63 R10: dffffc0000000000 R11: fffff52000132f64 R12: 00007fffffffefc0 R13: 000000007ff6ca80 R14: 00002000000c6000 R15: ffffc90000997ae0 copy_to_user include/linux/uaccess.h:169 [inline] rng_dev_read+0x4b8/0x960 drivers/char/hw_random/core.c:267 do_loop_readv_writev fs/read_write.c:756 [inline] do_iter_read+0x4c5/0xb40 fs/read_write.c:798 vfs_readv fs/read_write.c:916 [inline] do_preadv+0x232/0x390 fs/read_write.c:1008 __do_sys_preadv fs/read_write.c:1058 [inline] __se_sys_preadv fs/read_write.c:1053 [inline] __x64_sys_preadv+0x9e/0xb0 fs/read_write.c:1053 x64_sys_call+0x370/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:296 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f126939acb9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f126a266028 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00007f1269615fa0 RCX: 00007f126939acb9 RDX: 0000000000000001 RSI: 0000200000000240 RDI: 0000000000000003 RBP: 00007f1269408bf7 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f1269616038 R14: 00007f1269615fa0 R15: 00007ffd323c5c08 The buggy address belongs to the physical page: page:ffffea0004c20d80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x130836 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004c20d88 ffffea0004c20d88 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner info is not present (never set?) Memory state around the buggy address: ffff888130835f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888130835f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888130836000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888130836080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888130836100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop2): ext4_ext_split:1080: inode #15: comm syz.2.18: p_ext > EXT_MAX_EXTENT! EXT4-fs (loop2): pa ffff888124f59498: logic 688, phys. 129, len 16 EXT4-fs error (device loop2): ext4_mb_release_inode_pa:4892: group 0, free 9, pa_free 8 ---------------- Code disassembly (best guess): 0: ff c9 dec %ecx 2: 75 f2 jne 0xfffffff6 4: 89 d1 mov %edx,%ecx 6: c1 e9 03 shr $0x3,%ecx 9: 83 e2 07 and $0x7,%edx c: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) f: 89 d1 mov %edx,%ecx 11: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) 13: 31 c0 xor %eax,%eax 15: 0f 01 ca clac 18: c3 ret 19: 8d 0c ca lea (%rdx,%rcx,8),%ecx 1c: 89 ca mov %ecx,%edx 1e: eb 20 jmp 0x40 20: 0f 01 cb stac 23: 83 fa 40 cmp $0x40,%edx 26: 72 38 jb 0x60 28: 89 d1 mov %edx,%ecx * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: 31 c0 xor %eax,%eax 2e: 0f 01 ca clac 31: c3 ret 32: 89 ca mov %ecx,%edx 34: eb 0a jmp 0x40 36: 90 nop 37: 90 nop 38: 90 nop 39: 90 nop 3a: 90 nop 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 90 nop 3f: 90 nop