loop0: detected capacity change from 0 to 16 erofs: (device loop0): mounted with root inode @ nid 36. ================================================================== BUG: KASAN: slab-out-of-bounds in z_erofs_transform_plain+0x375/0x470 fs/erofs/decompressor.c:356 Read of size 4096 at addr ffff888023080000 by task syz-executor.0/3968 CPU: 0 PID: 3968 Comm: syz-executor.0 Not tainted 6.1.77-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 kasan_check_range+0x27f/0x290 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 z_erofs_transform_plain+0x375/0x470 fs/erofs/decompressor.c:356 z_erofs_decompress_pcluster fs/erofs/zdata.c:1173 [inline] z_erofs_decompress_queue+0x1aa0/0x2d50 fs/erofs/zdata.c:1256 z_erofs_runqueue+0x1a6e/0x1ca0 fs/erofs/zdata.c:1614 z_erofs_read_folio+0x478/0x760 fs/erofs/zdata.c:1709 filemap_read_folio+0x199/0x780 mm/filemap.c:2461 filemap_update_page mm/filemap.c:2546 [inline] filemap_get_pages mm/filemap.c:2660 [inline] filemap_read+0x1a13/0x31d0 mm/filemap.c:2730 __kernel_read+0x41e/0x8a0 fs/read_write.c:428 integrity_kernel_read+0xac/0xf0 security/integrity/iint.c:228 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+0xa57/0x1c00 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x59a/0xc30 security/integrity/ima/ima_api.c:293 process_measurement+0x135c/0x21b0 security/integrity/ima/ima_main.c:351 ima_file_check+0xed/0x170 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3630 [inline] path_openat+0x2687/0x2e60 fs/namei.c:3785 do_filp_open+0x230/0x480 fs/namei.c:3812 do_sys_openat2+0x13b/0x500 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_open fs/open.c:1342 [inline] __se_sys_open fs/open.c:1338 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1338 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe2ed47dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe2ee1f20c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007fe2ed5abf80 RCX: 00007fe2ed47dda9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007fe2ed4ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe2ed5abf80 R15: 00007fff39e0f568 Allocated by task 1: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:679 [inline] __kernfs_new_node+0xd4/0x870 fs/kernfs/dir.c:608 kernfs_new_node+0x136/0x230 fs/kernfs/dir.c:684 __kernfs_create_file+0x45/0x2e0 fs/kernfs/file.c:1043 sysfs_add_file_mode_ns+0x246/0x300 fs/sysfs/file.c:294 sysfs_merge_group+0x1f9/0x440 fs/sysfs/group.c:342 dpm_sysfs_add+0xcf/0x270 drivers/base/power/sysfs.c:707 device_add+0x702/0xfd0 drivers/base/core.c:3621 usb_hub_create_port_device+0x3ef/0xb50 drivers/usb/core/port.c:674 hub_configure drivers/usb/core/hub.c:1676 [inline] hub_probe+0x249b/0x3580 drivers/usb/core/hub.c:1921 usb_probe_interface+0x5c0/0xaf0 drivers/usb/core/driver.c:396 really_probe+0x2ab/0xcb0 drivers/base/dd.c:639 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785 driver_probe_device+0x50/0x420 drivers/base/dd.c:815 __device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427 __device_attach+0x359/0x570 drivers/base/dd.c:1015 bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487 device_add+0xb48/0xfd0 drivers/base/core.c:3664 usb_set_configuration+0x19dd/0x2020 drivers/usb/core/message.c:2165 usb_generic_driver_probe+0x84/0x140 drivers/usb/core/generic.c:238 usb_probe_device+0x130/0x260 drivers/usb/core/driver.c:293 really_probe+0x2ab/0xcb0 drivers/base/dd.c:639 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785 driver_probe_device+0x50/0x420 drivers/base/dd.c:815 __device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427 __device_attach+0x359/0x570 drivers/base/dd.c:1015 bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487 device_add+0xb48/0xfd0 drivers/base/core.c:3664 usb_new_device+0xbdd/0x18e0 drivers/usb/core/hub.c:2597 register_root_hub+0x25f/0x540 drivers/usb/core/hcd.c:1021 usb_add_hcd+0xc4e/0x1250 drivers/usb/core/hcd.c:2995 vhci_hcd_probe+0x1f0/0x3b0 drivers/usb/usbip/vhci_hcd.c:1376 platform_probe+0x131/0x1b0 drivers/base/platform.c:1400 really_probe+0x2ab/0xcb0 drivers/base/dd.c:639 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785 driver_probe_device+0x50/0x420 drivers/base/dd.c:815 __device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427 __device_attach+0x359/0x570 drivers/base/dd.c:1015 bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487 device_add+0xb48/0xfd0 drivers/base/core.c:3664 platform_device_add+0x46e/0x7d0 drivers/base/platform.c:717 vhci_hcd_init+0x3e4/0x508 drivers/usb/usbip/vhci_hcd.c:1546 do_one_initcall+0x265/0x8f0 init/main.c:1296 do_initcall_level+0x157/0x207 init/main.c:1369 do_initcalls+0x49/0x86 init/main.c:1385 kernel_init_freeable+0x45c/0x60f init/main.c:1624 kernel_init+0x19/0x290 init/main.c:1512 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff888023080000 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 0 bytes inside of 168-byte region [ffff888023080000, ffff8880230800a8) The buggy address belongs to the physical page: page:ffffea00008c2000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x23080 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff888140009c80 raw: 0000000000000000 0000000000110011 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 8896449817, free_ts 8636136030 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513 prep_new_page mm/page_alloc.c:2520 [inline] get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5545 alloc_page_interleave+0x22/0x1c0 mm/mempolicy.c:2115 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1a5/0x2d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:679 [inline] __kernfs_new_node+0xd4/0x870 fs/kernfs/dir.c:608 kernfs_new_node+0x136/0x230 fs/kernfs/dir.c:684 __kernfs_create_file+0x45/0x2e0 fs/kernfs/file.c:1043 sysfs_add_file_mode_ns+0x246/0x300 fs/sysfs/file.c:294 sysfs_merge_group+0x1f9/0x440 fs/sysfs/group.c:342 dpm_sysfs_add+0xcf/0x270 drivers/base/power/sysfs.c:707 device_add+0x702/0xfd0 drivers/base/core.c:3621 usb_hub_create_port_device+0x3ef/0xb50 drivers/usb/core/port.c:674 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1440 [inline] free_pcp_prepare mm/page_alloc.c:1490 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453 __vunmap+0x834/0x9a0 mm/vmalloc.c:2717 free_work+0x57/0x80 mm/vmalloc.c:97 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff88802307ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888023080000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888023080080: 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 ^ ffff888023080100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888023080180: 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ==================================================================