loop0: detected capacity change from 0 to 128 UDF-fs: error (device loop0): udf_read_tagged: read failed, block=256, location=256 UDF-fs: error (device loop0): udf_bitmap_new_block: bitmap for partition 0 corrupted (block 264 marked as free, partition length is 40) loop0: detected capacity change from 128 to 0 syz.0.0: attempt to access beyond end of device loop0: rw=0, sector=116, nr_sectors = 1 limit=0 syz.0.0: attempt to access beyond end of device loop0: rw=0, sector=116, nr_sectors = 1 limit=0 syz.0.0: attempt to access beyond end of device loop0: rw=0, sector=116, nr_sectors = 1 limit=0 syz.0.0: attempt to access beyond end of device loop0: rw=0, sector=117, nr_sectors = 1 limit=0 syz.0.0: attempt to access beyond end of device loop0: rw=0, sector=117, nr_sectors = 1 limit=0 ================================================================== BUG: KASAN: slab-out-of-bounds in udf_get_filelongad+0x167/0x1b0 fs/udf/directory.c:526 Read of size 4 at addr ffff88801a9ffb30 by task syz.0.0/5111 CPU: 0 UID: 0 PID: 5111 Comm: syz.0.0 Not tainted 6.11.0-rc6-syzkaller-00019-g67784a74e258 #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:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 udf_get_filelongad+0x167/0x1b0 fs/udf/directory.c:526 udf_current_aext+0x435/0x9e0 fs/udf/inode.c:2235 udf_next_aext+0x8c/0x4a0 fs/udf/inode.c:2171 udf_extend_file fs/udf/inode.c:677 [inline] udf_setsize+0xa8a/0x1280 fs/udf/inode.c:1265 udf_setattr+0x3c7/0x5d0 fs/udf/file.c:236 notify_change+0xbca/0xe90 fs/attr.c:503 do_truncate fs/open.c:65 [inline] do_ftruncate+0x46b/0x590 fs/open.c:181 do_sys_ftruncate fs/open.c:199 [inline] __do_sys_ftruncate fs/open.c:207 [inline] __se_sys_ftruncate fs/open.c:205 [inline] __x64_sys_ftruncate+0x95/0xf0 fs/open.c:205 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:0x7f717d379eb9 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:00007f717e204038 EFLAGS: 00000246 ORIG_RAX: 000000000000004d RAX: ffffffffffffffda RBX: 00007f717d515f80 RCX: 00007f717d379eb9 RDX: 0000000000000000 RSI: 0000008002007ffb RDI: 0000000000000005 RBP: 00007f717d3e793e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f717d515f80 R15: 00007fff66e16708 Allocated by task 5096: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __kmalloc_cache_noprof+0x19c/0x2c0 mm/slub.c:4189 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] drm_atomic_helper_setup_commit+0x1cf/0x1480 drivers/gpu/drm/drm_atomic_helper.c:2289 drm_atomic_helper_commit+0x62/0x9f0 drivers/gpu/drm/drm_atomic_helper.c:2023 drm_atomic_commit+0x296/0x2f0 drivers/gpu/drm/drm_atomic.c:1522 drm_atomic_helper_dirtyfb+0xd10/0xe70 drivers/gpu/drm/drm_damage_helper.c:181 drm_fbdev_shmem_helper_fb_dirty+0x151/0x2c0 drivers/gpu/drm/drm_fbdev_shmem.c:197 drm_fb_helper_fb_dirty drivers/gpu/drm/drm_fb_helper.c:383 [inline] drm_fb_helper_damage_work+0x275/0x880 drivers/gpu/drm/drm_fb_helper.c:406 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 5096: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x149/0x360 mm/slub.c:4594 kref_put include/linux/kref.h:65 [inline] drm_crtc_commit_put include/drm/drm_atomic.h:505 [inline] __drm_atomic_helper_plane_destroy_state+0x139/0x1b0 drivers/gpu/drm/drm_atomic_state_helper.c:399 drm_atomic_helper_plane_destroy_state+0x15/0x20 drivers/gpu/drm/drm_atomic_state_helper.c:416 drm_atomic_state_default_clear+0x68a/0xb40 drivers/gpu/drm/drm_atomic.c:245 drm_atomic_state_clear drivers/gpu/drm/drm_atomic.c:294 [inline] __drm_atomic_state_free+0xb8/0x210 drivers/gpu/drm/drm_atomic.c:311 kref_put include/linux/kref.h:65 [inline] drm_atomic_state_put include/drm/drm_atomic.h:538 [inline] drm_atomic_helper_dirtyfb+0xdc5/0xe70 drivers/gpu/drm/drm_damage_helper.c:193 drm_fbdev_shmem_helper_fb_dirty+0x151/0x2c0 drivers/gpu/drm/drm_fbdev_shmem.c:197 drm_fb_helper_fb_dirty drivers/gpu/drm/drm_fb_helper.c:383 [inline] drm_fb_helper_damage_work+0x275/0x880 drivers/gpu/drm/drm_fb_helper.c:406 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88801a9ff800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 304 bytes to the right of allocated 512-byte region [ffff88801a9ff800, ffff88801a9ffa00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801a9ff000 pfn:0x1a9fe head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000240 ffff88801ac41c80 ffffea0000795090 ffffea000048e190 raw: ffff88801a9ff000 0000000000080007 00000001fdffffff 0000000000000000 head: 00fff00000000240 ffff88801ac41c80 ffffea0000795090 ffffea000048e190 head: ffff88801a9ff000 0000000000080007 00000001fdffffff 0000000000000000 head: 00fff00000000001 ffffea00006a7f81 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4597, tgid 4597 (udevd), ts 34107131894, free_ts 34083587722 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __kmalloc_cache_noprof+0x1d5/0x2c0 mm/slub.c:4184 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] kernfs_fop_open+0x3e0/0xd10 fs/kernfs/file.c:623 do_dentry_open+0x970/0x1440 fs/open.c:959 vfs_open+0x3e/0x330 fs/open.c:1089 do_open fs/namei.c:3727 [inline] path_openat+0x2b3e/0x3470 fs/namei.c:3886 do_filp_open+0x235/0x490 fs/namei.c:3913 do_sys_openat2+0x13e/0x1d0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_openat fs/open.c:1447 [inline] __se_sys_openat fs/open.c:1442 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1442 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 4622 tgid 4622 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2612 mm_free_pgd kernel/fork.c:802 [inline] __mmdrop+0xb9/0x3d0 kernel/fork.c:918 exec_mmap+0x680/0x710 fs/exec.c:1089 begin_new_exec+0x12c6/0x2050 fs/exec.c:1355 load_elf_binary+0x969/0x2680 fs/binfmt_elf.c:996 search_binary_handler fs/exec.c:1827 [inline] exec_binprm fs/exec.c:1869 [inline] bprm_execve+0xaf8/0x1770 fs/exec.c:1920 do_execveat_common+0x55f/0x6f0 fs/exec.c:2027 do_execve fs/exec.c:2101 [inline] __do_sys_execve fs/exec.c:2177 [inline] __se_sys_execve fs/exec.c:2172 [inline] __x64_sys_execve+0x92/0xb0 fs/exec.c:2172 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: ffff88801a9ffa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801a9ffa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801a9ffb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801a9ffb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801a9ffc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================