loop0: detected capacity change from 2048 to 64 ================================================================== BUG: KASAN: use-after-free in crc_itu_t+0x1b1/0x290 lib/crc/crc-itu-t.c:61 Read of size 1 at addr ffff88804c974000 by task syz.0.0/5358 CPU: 0 UID: 0 PID: 5358 Comm: syz.0.0 Not tainted 6.16.0-syzkaller-11579-g35a813e010b9 #0 PREEMPT(full) 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_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 crc_itu_t+0x1b1/0x290 lib/crc/crc-itu-t.c:61 udf_update_tag+0x7a/0x6f0 fs/udf/misc.c:261 udf_write_aext+0x4c3/0x7b0 fs/udf/inode.c:2187 udf_do_extend_file+0x322/0x1180 fs/udf/inode.c:561 udf_extend_file fs/udf/inode.c:712 [inline] udf_setsize+0xb78/0x1000 fs/udf/inode.c:1300 udf_setattr+0x3a1/0x5a0 fs/udf/file.c:236 notify_change+0xb33/0xe40 fs/attr.c:552 do_truncate+0x1a4/0x220 fs/open.c:68 vfs_truncate+0x493/0x520 fs/open.c:118 do_sys_truncate+0xdb/0x190 fs/open.c:141 __do_sys_truncate fs/open.c:153 [inline] __se_sys_truncate fs/open.c:151 [inline] __x64_sys_truncate+0x5b/0x70 fs/open.c:151 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb53698eb69 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:00007fb537782038 EFLAGS: 00000246 ORIG_RAX: 000000000000004c RAX: ffffffffffffffda RBX: 00007fb536bb6080 RCX: 00007fb53698eb69 RDX: 0000000000000000 RSI: 000000400000f000 RDI: 0000200000000080 RBP: 00007fb536a11df1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb536bb6080 R15: 00007fffb41b32f8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x19 pfn:0x4c974 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea0001324a08 ffffea0001325e08 0000000000000000 raw: 0000000000000019 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_MOVABLE|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL), pid 5357, tgid 5356 (syz.0.0), ts 85944043654, free_ts 86058016110 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline] alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2507 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2517 filemap_alloc_folio_noprof+0xdf/0x470 mm/filemap.c:1007 __filemap_get_folio+0x3f2/0xaf0 mm/filemap.c:1981 grow_dev_folio fs/buffer.c:1050 [inline] grow_buffers fs/buffer.c:1116 [inline] __getblk_slow fs/buffer.c:1134 [inline] bdev_getblk+0x1ad/0x660 fs/buffer.c:1461 __bread_gfp+0x89/0x3c0 fs/buffer.c:1515 sb_bread include/linux/buffer_head.h:346 [inline] udf_read_tagged+0xad/0xe00 fs/udf/misc.c:199 udf_process_sequence+0x1bd/0x47e0 fs/udf/super.c:1771 udf_load_sequence fs/udf/super.c:1884 [inline] udf_check_anchor_block+0x28e/0x550 fs/udf/super.c:1919 udf_scan_anchors fs/udf/super.c:1952 [inline] udf_load_vrs+0x6e3/0xf20 fs/udf/super.c:2033 udf_fill_super+0x5ad/0x17a0 fs/udf/super.c:2201 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1692 page last free pid 5358 tgid 5356 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] free_unref_folios+0xdbd/0x1520 mm/page_alloc.c:2952 folios_put_refs+0x559/0x640 mm/swap.c:997 folio_batch_release include/linux/pagevec.h:101 [inline] mapping_try_invalidate+0x324/0x410 mm/truncate.c:554 loop_set_status+0x1d0/0xb40 drivers/block/loop.c:1234 lo_ioctl+0x9af/0x1d00 drivers/block/loop.c:-1 blkdev_ioctl+0x5a8/0x6d0 block/ioctl.c:705 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88804c973f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804c973f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804c974000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804c974080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804c974100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================