hfsplus: request for non-existent node 768 in B*Tree hfsplus: request for non-existent node 768 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x22b/0x240 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff88811d198ac0 by task syz-executor.2/11619 CPU: 1 PID: 11619 Comm: syz-executor.2 Not tainted 6.8.0-syzkaller-11409-gf6cef5f8c37f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 hfsplus_bnode_read+0x22b/0x240 fs/hfsplus/bnode.c:32 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x2a2/0x3e0 fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x3e2/0x4f0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x2a2/0x3b0 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x271/0x330 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x844/0xdd0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x213/0x7f0 fs/hfsplus/dir.c:385 hfsplus_rename+0xbc/0x200 fs/hfsplus/dir.c:547 vfs_rename+0xf84/0x20a0 fs/namei.c:4883 do_renameat2+0xc54/0xdc0 fs/namei.c:5040 __do_sys_rename fs/namei.c:5087 [inline] __se_sys_rename fs/namei.c:5085 [inline] __x64_sys_rename+0x81/0xa0 fs/namei.c:5085 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7ff71607dda9 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:00007ff716e890c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007ff7161abf80 RCX: 00007ff71607dda9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000020000080 RBP: 00007ff7160ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007ff7161abf80 R15: 00007ffcf3a1d658 Allocated by task 11619: 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:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3966 [inline] __kmalloc+0x1f9/0x440 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] __hfs_bnode_create+0x108/0x870 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x2c8/0xcb0 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x2b9/0x520 fs/hfsplus/bfind.c:183 hfsplus_find_attr fs/hfsplus/attributes.c:160 [inline] hfsplus_delete_all_attrs+0x24a/0x330 fs/hfsplus/attributes.c:371 hfsplus_delete_cat+0x844/0xdd0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x213/0x7f0 fs/hfsplus/dir.c:385 hfsplus_rename+0xbc/0x200 fs/hfsplus/dir.c:547 vfs_rename+0xf84/0x20a0 fs/namei.c:4883 do_renameat2+0xc54/0xdc0 fs/namei.c:5040 __do_sys_rename fs/namei.c:5087 [inline] __se_sys_rename fs/namei.c:5085 [inline] __x64_sys_rename+0x81/0xa0 fs/namei.c:5085 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff88811d198a00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 40 bytes to the right of allocated 152-byte region [ffff88811d198a00, ffff88811d198a98) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d198 ksm flags: 0x57ff80000000800(slab|node=1|zone=2|lastcpupid=0xfff) page_type: 0xffffffff() raw: 057ff80000000800 ffff888015042a00 ffffea0004ecbf00 dead000000000003 raw: 0000000000000000 0000000080100010 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 8029, tgid 8029 (syz-executor.0), ts 147363175292, free_ts 144462155750 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x23f0 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc_node+0x36e/0x480 mm/slub.c:3973 kmalloc_array_node include/linux/slab.h:726 [inline] kcalloc_node include/linux/slab.h:731 [inline] memcg_alloc_slab_cgroups+0xa9/0x180 mm/memcontrol.c:3015 __memcg_slab_post_alloc_hook+0xa3/0x370 mm/slub.c:1960 memcg_slab_post_alloc_hook mm/slub.c:1983 [inline] slab_post_alloc_hook mm/slub.c:3807 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc+0x310/0x320 mm/slub.c:3852 kmem_cache_zalloc include/linux/slab.h:739 [inline] alloc_buffer_head+0x21/0x160 fs/buffer.c:3001 folio_alloc_buffers+0x2c8/0x7d0 fs/buffer.c:924 create_empty_buffers+0x36/0x480 fs/buffer.c:1650 ext4_block_write_begin+0xccd/0xef0 fs/ext4/inode.c:1038 ext4_da_write_begin+0x410/0x8c0 fs/ext4/inode.c:2894 generic_perform_write+0x272/0x620 mm/filemap.c:3974 page last free pid 38 tgid 38 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 __folio_put_small mm/swap.c:119 [inline] __folio_put+0x166/0x1f0 mm/swap.c:142 folio_put include/linux/mm.h:1506 [inline] free_page_and_swap_cache+0x1eb/0x250 mm/swap_state.c:305 __tlb_remove_table arch/x86/include/asm/tlb.h:34 [inline] __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x89/0xe0 mm/mmu_gather.c:282 rcu_do_batch kernel/rcu/tree.c:2196 [inline] rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2471 __do_softirq+0x218/0x8de kernel/softirq.c:554 Memory state around the buggy address: ffff88811d198980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88811d198a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88811d198a80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88811d198b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811d198b80: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================