loop0: detected capacity change from 0 to 64 ================================================================== BUG: KASAN: slab-out-of-bounds in memcpy_from_page include/linux/highmem.h:423 [inline] BUG: KASAN: slab-out-of-bounds in hfs_bnode_read+0xbc/0x220 fs/hfs/bnode.c:35 Write of size 94 at addr ffff888031fb8b00 by task syz-executor313/5842 CPU: 0 UID: 0 PID: 5842 Comm: syz-executor313 Not tainted 6.12.0-syzkaller-07834-g06afb0f36106 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 __asan_memcpy+0x3c/0x60 mm/kasan/shadow.c:106 memcpy_from_page include/linux/highmem.h:423 [inline] hfs_bnode_read+0xbc/0x220 fs/hfs/bnode.c:35 hfs_bnode_read_key+0x14e/0x1f0 fs/hfs/bnode.c:70 hfs_brec_insert+0x66b/0xb90 fs/hfs/brec.c:159 hfs_cat_move+0x3f0/0x7e0 fs/hfs/catalog.c:336 hfs_rename+0xe8/0x200 fs/hfs/dir.c:299 vfs_rename+0xf8b/0x21f0 fs/namei.c:5067 do_renameat2+0xc5f/0xdd0 fs/namei.c:5224 __do_sys_renameat2 fs/namei.c:5258 [inline] __se_sys_renameat2 fs/namei.c:5255 [inline] __x64_sys_renameat2+0xe7/0x130 fs/namei.c:5255 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f69b1f04ad9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffea7d94808 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f69b1f04ad9 RDX: 0000000000000004 RSI: 0000000020000380 RDI: 0000000000000004 RBP: 00007f69b1f785f0 R08: 0000000000000000 R09: 000055558d6a54c0 R10: 0000000020000200 R11: 0000000000000246 R12: 00007ffea7d94830 R13: 00007ffea7d94a58 R14: 431bde82d7b634db R15: 00007f69b1f4d03b Allocated by task 5842: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __do_kmalloc_node mm/slub.c:4264 [inline] __kmalloc_noprof+0x1e8/0x400 mm/slub.c:4276 kmalloc_noprof include/linux/slab.h:883 [inline] hfs_find_init+0x95/0x220 fs/hfs/bfind.c:21 hfs_cat_move+0x15a/0x7e0 fs/hfs/catalog.c:301 hfs_rename+0xe8/0x200 fs/hfs/dir.c:299 vfs_rename+0xf8b/0x21f0 fs/namei.c:5067 do_renameat2+0xc5f/0xdd0 fs/namei.c:5224 __do_sys_renameat2 fs/namei.c:5258 [inline] __se_sys_renameat2 fs/namei.c:5255 [inline] __x64_sys_renameat2+0xe7/0x130 fs/namei.c:5255 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031fb8b00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 0 bytes inside of allocated 78-byte region [ffff888031fb8b00, ffff888031fb8b4e) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31fb8 ksm flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b041280 ffffea000510f340 0000000000000003 raw: 0000000000000000 0000000080200020 00000001f5000000 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 0x52c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5219, tgid 5219 (udevd), ts 49463600367, free_ts 49313720845 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_noprof+0x367/0x400 mm/slub.c:4276 kmalloc_noprof include/linux/slab.h:883 [inline] kzalloc_noprof include/linux/slab.h:1015 [inline] tomoyo_encode2+0x100/0x3e0 security/tomoyo/realpath.c:45 tomoyo_encode+0x29/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x19d/0x720 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x276/0x460 security/tomoyo/file.c:822 security_inode_getattr+0x116/0x290 security/security.c:2372 vfs_getattr fs/stat.c:243 [inline] vfs_statx_path+0x2b/0x310 fs/stat.c:283 vfs_statx+0x11f/0x1c0 fs/stat.c:347 vfs_fstatat+0x7b/0xf0 fs/stat.c:366 page last free pid 5428 tgid 5428 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xa7b/0x14f0 mm/page_alloc.c:2704 folios_put_refs+0x587/0x7b0 mm/swap.c:993 free_pages_and_swap_cache+0x45f/0x510 mm/swap_state.c:335 __tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu mm/mmu_gather.c:373 [inline] tlb_finish_mmu+0x168/0x7b0 mm/mmu_gather.c:465 exit_mmap+0x3df/0xb30 mm/mmap.c:1936 __mmput+0x12a/0x480 kernel/fork.c:1348 mmput+0x62/0x70 kernel/fork.c:1370 exit_mm kernel/exit.c:570 [inline] do_exit+0x9bf/0x2d70 kernel/exit.c:925 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 __do_sys_exit_group kernel/exit.c:1098 [inline] __se_sys_exit_group kernel/exit.c:1096 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1096 x64_sys_call+0x151f/0x1720 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888031fb8a00: 00 00 00 00 00 00 00 00 06 fc fc fc fc fc fc fc ffff888031fb8a80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff888031fb8b00: 00 00 00 00 00 00 00 00 00 06 fc fc fc fc fc fc ^ ffff888031fb8b80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888031fb8c00: 00 00 00 00 00 00 00 00 03 fc fc fc fc fc fc fc ==================================================================