UDF-fs: error (device loop0): udf_read_inode: (ino 819) failed !bh ================================================================== BUG: KASAN: use-after-free in crc_itu_t+0x1d5/0x2b0 lib/crc-itu-t.c:60 Read of size 1 at addr ffff88804d206000 by task syz.0.0/5320 CPU: 0 UID: 0 PID: 5320 Comm: syz.0.0 Not tainted 6.12.0-syzkaller-11677-g2ba9f676d0a2 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 crc_itu_t+0x1d5/0x2b0 lib/crc-itu-t.c:60 udf_update_tag+0x70/0x6a0 fs/udf/misc.c:261 udf_write_aext+0x4d8/0x7b0 fs/udf/inode.c:2179 udf_do_extend_file+0x38e/0x1280 fs/udf/inode.c:554 inode_getblk fs/udf/inode.c:835 [inline] udf_map_block+0x1896/0x5340 fs/udf/inode.c:447 __udf_get_block+0x126/0x410 fs/udf/inode.c:461 __block_write_begin_int+0x50c/0x1a70 fs/buffer.c:2116 block_write_begin+0x8f/0x120 fs/buffer.c:2226 udf_write_begin+0x104/0x350 fs/udf/inode.c:256 generic_perform_write+0x344/0x6d0 mm/filemap.c:4055 udf_file_write_iter+0x2fc/0x660 fs/udf/file.c:111 do_iter_readv_writev+0x600/0x880 vfs_writev+0x376/0xba0 fs/read_write.c:1050 do_pwritev fs/read_write.c:1146 [inline] __do_sys_pwritev2 fs/read_write.c:1204 [inline] __se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f258bb80849 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:00007f258c8cb058 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f258bd46160 RCX: 00007f258bb80849 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000005 RBP: 00007f258bbf3986 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000008003000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f258bd46160 R15: 00007ffcfbf44138 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x8 pfn:0x4d206 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea000134fd08 ffffea0001344008 0000000000000000 raw: 0000000000000008 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 0x148c48(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 5318, tgid 5317 (syz.0.0), ts 69290988931, free_ts 69404378509 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3474 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 alloc_pages_noprof mm/mempolicy.c:2344 [inline] folio_alloc_noprof+0x128/0x180 mm/mempolicy.c:2351 filemap_alloc_folio_noprof+0xdf/0x500 mm/filemap.c:1009 __filemap_get_folio+0x446/0xbd0 mm/filemap.c:1951 grow_dev_folio fs/buffer.c:1039 [inline] grow_buffers fs/buffer.c:1105 [inline] __getblk_slow fs/buffer.c:1131 [inline] bdev_getblk+0x1d8/0x550 fs/buffer.c:1431 __bread_gfp+0x86/0x400 fs/buffer.c:1485 sb_bread include/linux/buffer_head.h:346 [inline] udf_check_vsd fs/udf/super.c:772 [inline] udf_load_vrs+0x394/0x1130 fs/udf/super.c:2006 udf_fill_super+0x5eb/0x1ed0 fs/udf/super.c:2192 get_tree_bdev_flags+0x48c/0x5c0 fs/super.c:1636 vfs_get_tree+0x90/0x2b0 fs/super.c:1814 do_new_mount+0x2be/0xb40 fs/namespace.c:3507 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 page last free pid 5319 tgid 5317 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xf62/0x1a90 mm/page_alloc.c:2704 folios_put_refs+0x76c/0x860 mm/swap.c:962 folio_batch_release include/linux/pagevec.h:101 [inline] mapping_try_invalidate+0x3f7/0x550 mm/truncate.c:501 loop_set_status+0x1ab/0x8f0 drivers/block/loop.c:1263 lo_ioctl+0xcbc/0x1f50 blkdev_ioctl+0x57d/0x6a0 block/ioctl.c:693 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88804d205f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804d205f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804d206000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804d206080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804d206100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================