================================================================== BUG: KASAN: use-after-free in udf_write_aext+0x5e9/0x7a0 fs/udf/inode.c:2110 Write of size 4 at addr ffff88801f993ff0 by task syz.0.36/3833 CPU: 1 PID: 3833 Comm: syz.0.36 Not tainted 5.15.162-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 udf_write_aext+0x5e9/0x7a0 fs/udf/inode.c:2110 udf_add_entry+0x17b7/0x3350 fs/udf/namei.c:482 udf_mkdir+0x1a8/0xaa0 fs/udf/namei.c:681 vfs_mkdir+0x3b6/0x590 fs/namei.c:4065 do_mkdirat+0x260/0x520 fs/namei.c:4090 __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fb57c54dbd9 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:00007fb57afce048 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fb57c6dbf60 RCX: 00007fb57c54dbd9 RDX: 0000000000000000 RSI: 00000000200002c0 RDI: ffffffffffffff9c RBP: 00007fb57c5bcaa1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000004d R14: 00007fb57c6dbf60 R15: 00007ffee69a9428 The buggy address belongs to the page: page:ffffea00007e64c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f993 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00007d5608 ffffea00007e6488 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 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 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 3842, ts 74839817040, free_ts 74877757047 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 vm_area_alloc_pages mm/vmalloc.c:2868 [inline] __vmalloc_area_node mm/vmalloc.c:2924 [inline] __vmalloc_node_range+0x5ab/0x8c0 mm/vmalloc.c:3029 vmalloc_user+0x70/0x80 mm/vmalloc.c:3165 kcov_mmap+0x28/0x120 kernel/kcov.c:465 call_mmap include/linux/fs.h:2177 [inline] mmap_region+0x10e7/0x1670 mm/mmap.c:1791 do_mmap+0x78d/0xe00 mm/mmap.c:1575 vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:551 ksys_mmap_pgoff+0x559/0x780 mm/mmap.c:1624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 __vunmap+0x8d4/0xa20 mm/vmalloc.c:2621 kcov_mmap+0x8f/0x120 kernel/kcov.c:489 call_mmap include/linux/fs.h:2177 [inline] mmap_region+0x10e7/0x1670 mm/mmap.c:1791 do_mmap+0x78d/0xe00 mm/mmap.c:1575 vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:551 ksys_mmap_pgoff+0x559/0x780 mm/mmap.c:1624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff88801f993e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88801f993f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88801f993f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88801f994000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801f994080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================