======================================================= hfsplus: request for non-existent node 256 in B*Tree hfsplus: request for non-existent node 256 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x232/0x250 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff888025e07ac0 by task syz-executor197/5042 CPU: 0 PID: 5042 Comm: syz-executor197 Not tainted 6.5.0-rc5-next-20230809-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 hfsplus_bnode_read+0x232/0x250 fs/hfsplus/bnode.c:32 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x2a2/0x3d0 fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x3de/0x4f0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x29e/0x3b0 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x26d/0x330 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x819/0xd90 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x213/0x7f0 fs/hfsplus/dir.c:385 vfs_unlink+0x2f1/0x900 fs/namei.c:4329 do_unlinkat+0x3da/0x6d0 fs/namei.c:4395 __do_sys_unlink fs/namei.c:4443 [inline] __se_sys_unlink fs/namei.c:4441 [inline] __x64_sys_unlink+0xc8/0x110 fs/namei.c:4441 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f7315df95f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 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:00007ffd62394308 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 00007ffd623944e8 RCX: 00007f7315df95f9 RDX: 00007f7315df88f0 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007f7315e6c610 R08: 000000000000066d R09: 0000000000000000 R10: 00007ffd623941d0 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffd623944d8 R14: 0000000000000001 R15: 0000000000000001 Allocated by task 5042: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1023 [inline] __kmalloc+0x60/0x100 mm/slab_common.c:1036 kmalloc include/linux/slab.h:603 [inline] kzalloc include/linux/slab.h:720 [inline] __hfs_bnode_create+0x108/0x860 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x2c4/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+0x246/0x330 fs/hfsplus/attributes.c:371 hfsplus_delete_cat+0x819/0xd90 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x213/0x7f0 fs/hfsplus/dir.c:385 vfs_unlink+0x2f1/0x900 fs/namei.c:4329 do_unlinkat+0x3da/0x6d0 fs/namei.c:4395 __do_sys_unlink fs/namei.c:4443 [inline] __se_sys_unlink fs/namei.c:4441 [inline] __x64_sys_unlink+0xc8/0x110 fs/namei.c:4441 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888025e07a00 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 [ffff888025e07a00, ffff888025e07a98) The buggy address belongs to the physical page: page:ffffea00009781c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25e07 anon flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff888012841a00 ffffea0000a3b180 0000000000000005 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 22991475915, free_ts 22866273542 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1567 prep_new_page mm/page_alloc.c:1574 [inline] get_page_from_freelist+0x10d7/0x31b0 mm/page_alloc.c:3253 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4509 alloc_page_interleave+0x1e/0x250 mm/mempolicy.c:2131 alloc_pages+0x22a/0x270 mm/mempolicy.c:2293 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1114 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] push_stack+0x7c/0x550 kernel/bpf/verifier.c:1834 check_cond_jmp_op kernel/bpf/verifier.c:14151 [inline] do_check kernel/bpf/verifier.c:16736 [inline] do_check_common+0x708e/0xd370 kernel/bpf/verifier.c:19071 do_check_main kernel/bpf/verifier.c:19134 [inline] bpf_check+0x8436/0xac50 kernel/bpf/verifier.c:19758 bpf_prog_load+0x153a/0x2270 kernel/bpf/syscall.c:2709 __sys_bpf+0xeed/0x4f10 kernel/bpf/syscall.c:5345 ____bpf_sys_bpf kernel/bpf/syscall.c:5480 [inline] kern_sys_bpf+0x13a/0x650 kernel/bpf/syscall.c:5528 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1158 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2380 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2475 vfree+0x181/0x7a0 mm/vmalloc.c:2842 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:2763 process_one_work+0x887/0x15d0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784 kthread+0x33a/0x430 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888025e07980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888025e07a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888025e07a80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888025e07b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888025e07b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================