================================================================== BUG: KASAN: use-after-free in udf_close_lvid+0x6a8/0x9a0 fs/udf/super.c:2035 Write of size 1 at addr ffff888071e42238 by task syz-executor.5/5061 CPU: 0 PID: 5061 Comm: syz-executor.5 Not tainted 6.5.0-syzkaller-11812-g7733171926cc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 udf_close_lvid+0x6a8/0x9a0 fs/udf/super.c:2035 udf_put_super+0xcd/0x160 fs/udf/super.c:2322 generic_shutdown_super+0x13a/0x2c0 fs/super.c:693 kill_block_super+0x41/0x70 fs/super.c:1646 deactivate_locked_super+0xa4/0x110 fs/super.c:481 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1254 task_work_run+0x24a/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fc2aba7de17 Code: b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffd659a2938 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fc2aba7de17 RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffd659a29f0 RBP: 00007ffd659a29f0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffd659a3ab0 R13: 00007fc2abac73b9 R14: 000000000021e14c R15: 000000000000001e The buggy address belongs to the physical page: page:ffffea0001c79080 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x71e42 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000001 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 0x152c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 5027, tgid 5027 (syz-executor), ts 52952155177, free_ts 1119692314366 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 folio_alloc+0x1e/0x60 mm/mempolicy.c:2308 filemap_alloc_folio+0xde/0x500 mm/filemap.c:976 page_cache_ra_unbounded+0x1f2/0x7c0 mm/readahead.c:247 filemap_readahead mm/filemap.c:2531 [inline] filemap_get_pages+0x742/0x2080 mm/filemap.c:2572 filemap_read+0x42b/0x10b0 mm/filemap.c:2652 __kernel_read+0x422/0x8e0 fs/read_write.c:428 integrity_kernel_read+0xb0/0xf0 security/integrity/iint.c:195 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0x164c/0x1d20 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x4a5/0x890 security/integrity/ima/ima_api.c:289 process_measurement+0xfea/0x1cf0 security/integrity/ima/ima_main.c:345 ima_file_check+0xf1/0x170 security/integrity/ima/ima_main.c:543 do_open fs/namei.c:3641 [inline] path_openat+0x2812/0x3180 fs/namei.c:3796 do_filp_open+0x234/0x490 fs/namei.c:3823 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x8c3/0x9f0 mm/page_alloc.c:2312 free_unref_page_list+0x596/0x830 mm/page_alloc.c:2451 release_pages+0x2113/0x23f0 mm/swap.c:1042 __folio_batch_release+0x84/0x100 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] mapping_try_invalidate+0x515/0x640 mm/truncate.c:535 drop_pagecache_sb+0x1bb/0x250 fs/drop_caches.c:40 iterate_supers+0xc2/0x180 fs/super.c:968 drop_caches_sysctl_handler+0x8c/0x160 fs/drop_caches.c:64 proc_sys_call_handler+0x546/0x8a0 fs/proc/proc_sysctl.c:600 do_iter_write+0x84f/0xde0 fs/read_write.c:860 iter_file_splice_write+0x86d/0x1010 fs/splice.c:736 do_splice_from fs/splice.c:933 [inline] direct_splice_actor+0xea/0x1c0 fs/splice.c:1142 splice_direct_to_actor+0x376/0x9e0 fs/splice.c:1088 do_splice_direct+0x2ac/0x3f0 fs/splice.c:1194 do_sendfile+0x623/0x1070 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1316 [inline] __se_sys_sendfile64+0x100/0x1e0 fs/read_write.c:1308 Memory state around the buggy address: ffff888071e42100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888071e42180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888071e42200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888071e42280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888071e42300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================