================================================================== BUG: KASAN: use-after-free in udf_write_aext+0x5e9/0x7a0 fs/udf/inode.c:2105 Write of size 4 at addr ffff888058463ff0 by task syz-executor.3/11494 CPU: 1 PID: 11494 Comm: syz-executor.3 Not tainted 6.1.92-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 udf_write_aext+0x5e9/0x7a0 fs/udf/inode.c:2105 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:4108 do_mkdirat+0x225/0x360 fs/namei.c:4133 __do_sys_mkdirat fs/namei.c:4148 [inline] __se_sys_mkdirat fs/namei.c:4146 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4146 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f01b187cee9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f01b25570c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f01b19abf80 RCX: 00007f01b187cee9 RDX: 0000000000000000 RSI: 0000000020000340 RDI: 0000000000000007 RBP: 00007f01b18c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f01b19abf80 R15: 00007ffe446a6c18 The buggy address belongs to the physical page: page:ffffea00016118c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x58463 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00013d6808 ffffea0000a35248 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 0x506dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_ZERO|__GFP_ACCOUNT), pid 11486, tgid 11485 (syz-executor.3), ts 427693151815, free_ts 427753239974 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513 prep_new_page mm/page_alloc.c:2520 [inline] get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5547 vm_area_alloc_pages mm/vmalloc.c:2983 [inline] __vmalloc_area_node mm/vmalloc.c:3051 [inline] __vmalloc_node_range+0x96c/0x1460 mm/vmalloc.c:3223 __bpf_map_area_alloc kernel/bpf/syscall.c:332 [inline] bpf_map_area_alloc+0xe0/0xf0 kernel/bpf/syscall.c:339 prealloc_init+0x139/0x860 kernel/bpf/hashtab.c:316 htab_map_alloc+0x9db/0x1000 kernel/bpf/hashtab.c:565 find_and_alloc_map kernel/bpf/syscall.c:131 [inline] map_create+0x4c0/0xd20 kernel/bpf/syscall.c:1128 __sys_bpf+0x2d3/0x6c0 kernel/bpf/syscall.c:4987 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1440 [inline] free_pcp_prepare mm/page_alloc.c:1490 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453 __vunmap+0x834/0x9a0 mm/vmalloc.c:2717 htab_free_elems kernel/bpf/hashtab.c:279 [inline] prealloc_destroy+0x24c/0x310 kernel/bpf/hashtab.c:369 htab_map_free+0x64d/0x900 kernel/bpf/hashtab.c:1528 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff888058463e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888058463f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888058463f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888058464000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888058464080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================