================================================================== BUG: KASAN: slab-out-of-bounds in udf_write_aext+0x6a7/0x7a0 fs/udf/inode.c:2094 Write of size 4 at addr ffff88801ed013f8 by task syz-executor291/4120 CPU: 1 PID: 4120 Comm: syz-executor291 Not tainted 5.15.111-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 udf_write_aext+0x6a7/0x7a0 fs/udf/inode.c:2094 udf_add_entry+0x17b7/0x3350 fs/udf/namei.c:482 udf_mkdir+0x1a8/0xaa0 fs/udf/namei.c:681 vfs_mkdir+0x419/0x640 fs/namei.c:3994 do_mkdirat+0x260/0x520 fs/namei.c:4019 __do_sys_mkdir fs/namei.c:4039 [inline] __se_sys_mkdir fs/namei.c:4037 [inline] __x64_sys_mkdir+0x6a/0x80 fs/namei.c:4037 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f98b987cfe7 Code: 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 53 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f98b9829118 EFLAGS: 00000246 ORIG_RAX: 0000000000000053 RAX: ffffffffffffffda RBX: 00007f98b98296b8 RCX: 00007f98b987cfe7 RDX: 0000000000000000 RSI: 00000000000001ff RDI: 0000000020000040 RBP: 00000000ffffffff R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000020000040 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 4129: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] kmalloc_array include/linux/slab.h:630 [inline] kcalloc include/linux/slab.h:660 [inline] udf_process_sequence+0x19f/0x4f20 fs/udf/super.c:1691 udf_load_sequence fs/udf/super.c:1815 [inline] udf_check_anchor_block+0x3f0/0x700 fs/udf/super.c:1855 udf_scan_anchors+0x15b/0x680 fs/udf/super.c:1888 udf_find_anchor fs/udf/super.c:1945 [inline] udf_load_vrs+0x229/0xc40 fs/udf/super.c:2010 udf_fill_super+0x99d/0x23a0 fs/udf/super.c:2188 mount_bdev+0x26d/0x3a0 fs/super.c:1378 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610 vfs_get_tree+0x88/0x270 fs/super.c:1508 do_new_mount+0x28b/0xad0 fs/namespace.c:2994 do_mount fs/namespace.c:3337 [inline] __do_sys_mount fs/namespace.c:3545 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3522 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 4129: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xf1/0x270 mm/slub.c:4559 udf_process_sequence+0x4336/0x4f20 fs/udf/super.c:1783 udf_load_sequence fs/udf/super.c:1815 [inline] udf_check_anchor_block+0x3f0/0x700 fs/udf/super.c:1855 udf_scan_anchors+0x15b/0x680 fs/udf/super.c:1888 udf_find_anchor fs/udf/super.c:1945 [inline] udf_load_vrs+0x229/0xc40 fs/udf/super.c:2010 udf_fill_super+0x99d/0x23a0 fs/udf/super.c:2188 mount_bdev+0x26d/0x3a0 fs/super.c:1378 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610 vfs_get_tree+0x88/0x270 fs/super.c:1508 do_new_mount+0x28b/0xad0 fs/namespace.c:2994 do_mount fs/namespace.c:3337 [inline] __do_sys_mount fs/namespace.c:3545 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3522 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88801ed01000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 504 bytes to the right of 512-byte region [ffff88801ed01000, ffff88801ed01200) The buggy address belongs to the page: page:ffffea00007b4000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1ed00 head:ffffea00007b4000 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000743400 0000000a00000002 ffff888011c41c80 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1700, ts 8864852253, free_ts 8858035360 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc_trace+0x1a0/0x290 mm/slub.c:3245 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] alloc_bprm+0x57/0x700 fs/exec.c:1514 kernel_execve+0x49/0x9b0 fs/exec.c:1970 call_usermodehelper_exec_async+0x22f/0x370 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 stack_depot_save+0x3ef/0x440 lib/stackdepot.c:335 kasan_save_stack mm/kasan/common.c:40 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0xa5/0xc0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xdb/0x730 fs/kernfs/dir.c:593 kernfs_new_node+0x95/0x160 fs/kernfs/dir.c:655 kernfs_create_link+0xa1/0x1f0 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x85/0x100 fs/sysfs/symlink.c:44 module_add_driver+0x299/0x2c0 drivers/base/module.c:66 bus_add_driver+0x398/0x600 drivers/base/bus.c:622 driver_register+0x2bf/0x3a0 drivers/base/driver.c:171 net2272_pci_register drivers/usb/gadget/udc/net2272.c:2590 [inline] net2272_init+0x1c/0x70 drivers/usb/gadget/udc/net2272.c:2702 do_one_initcall+0x22b/0x7a0 init/main.c:1306 do_initcall_level+0x157/0x207 init/main.c:1379 Memory state around the buggy address: ffff88801ed01280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801ed01300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801ed01380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801ed01400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801ed01480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================