UDF-fs: Scanning with blocksize 2048 failed UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) ================================================================== BUG: KASAN: use-after-free in udf_write_aext+0x62d/0x7e0 fs/udf/inode.c:2088 Write of size 4 at addr ffff888078157ff0 by task syz-executor.4/25549 CPU: 0 PID: 25549 Comm: syz-executor.4 Not tainted 6.2.0-rc5-syzkaller-00020-g7bf70dbb1882 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x290 lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:306 print_report+0x107/0x1f0 mm/kasan/report.c:417 kasan_report+0xcd/0x100 mm/kasan/report.c:517 udf_write_aext+0x62d/0x7e0 fs/udf/inode.c:2088 udf_add_entry+0x1712/0x3300 fs/udf/namei.c:482 udf_mkdir+0x13c/0x980 fs/udf/namei.c:681 vfs_mkdir+0x3b3/0x590 fs/namei.c:4036 do_mkdirat+0x25b/0x530 fs/namei.c:4061 __do_sys_mkdir fs/namei.c:4081 [inline] __se_sys_mkdir fs/namei.c:4079 [inline] __x64_sys_mkdir+0x6a/0x80 fs/namei.c:4079 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f66e4e8c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f66e5c7d168 EFLAGS: 00000246 ORIG_RAX: 0000000000000053 RAX: ffffffffffffffda RBX: 00007f66e4fabf80 RCX: 00007f66e4e8c0c9 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000020000000 RBP: 00007f66e4ee7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc444d19af R14: 00007f66e5c7d300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea0001e055c0 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x78157 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001d5d1c8 ffffea0000756988 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT), pid 25185, tgid 25185 (syz-executor.4), ts 982568089035, free_ts 982681787058 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x7f/0x320 arch/x86/mm/pgtable.c:33 __pte_alloc+0x75/0x220 mm/memory.c:421 do_anonymous_page+0xda9/0x10b0 mm/memory.c:4042 handle_pte_fault mm/memory.c:4929 [inline] __handle_mm_fault mm/memory.c:5073 [inline] handle_mm_fault+0x1610/0x26b0 mm/memory.c:5219 do_user_addr_fault+0x69b/0xcb0 arch/x86/mm/fault.c:1428 handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x7a/0x110 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x751/0x780 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page_list+0xb2/0x830 mm/page_alloc.c:3510 release_pages+0x233e/0x25e0 mm/swap.c:1076 tlb_batch_pages_flush mm/mmu_gather.c:97 [inline] tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu+0x860/0xa80 mm/mmu_gather.c:299 tlb_finish_mmu+0xcd/0x200 mm/mmu_gather.c:391 exit_mmap+0x275/0x630 mm/mmap.c:3100 __mmput+0x114/0x3b0 kernel/fork.c:1207 exit_mm+0x1ec/0x2c0 kernel/exit.c:563 do_exit+0x5c7/0x2150 kernel/exit.c:854 do_group_exit+0x1fd/0x2b0 kernel/exit.c:1012 get_signal+0x1701/0x17c0 kernel/signal.c:2859 arch_do_signal_or_restart+0x7b/0x5e0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop+0x74/0x150 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb2/0x140 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:296 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff888078157e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888078157f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888078157f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888078158000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888078158080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================