hfsplus: request for non-existent node 128 in B*Tree hfsplus: request for non-existent node 128 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x98/0x1a8 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff0000d23ff6c0 by task syz-executor/7339 CPU: 1 UID: 0 PID: 7339 Comm: syz-executor Not tainted 6.16.0-rc6-syzkaller-gaaef6f251176 #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 print_address_description+0xa8/0x220 mm/kasan/report.c:378 print_report+0x68/0x84 mm/kasan/report.c:480 kasan_report+0xb0/0x110 mm/kasan/report.c:593 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 hfsplus_bnode_read+0x98/0x1a8 fs/hfsplus/bnode.c:32 hfsplus_bnode_dump+0x274/0x384 fs/hfsplus/bnode.c:-1 hfsplus_brec_remove+0x3cc/0x4a0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x198/0x33c fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x228/0x390 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x82c/0xbb0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x2a8/0x63c fs/hfsplus/dir.c:385 vfs_unlink+0x2e0/0x520 fs/namei.c:4595 do_unlinkat+0x2f0/0x4dc fs/namei.c:4659 __do_sys_unlinkat fs/namei.c:4700 [inline] __se_sys_unlinkat fs/namei.c:4693 [inline] __arm64_sys_unlinkat+0xdc/0xf8 fs/namei.c:4693 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 Allocated by task 7339: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x44/0x54 mm/kasan/generic.c:562 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x9c/0xb4 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4328 [inline] __kmalloc_noprof+0x2fc/0x4c8 mm/slub.c:4340 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] __hfs_bnode_create+0xe0/0x6f4 fs/hfsplus/bnode.c:415 hfsplus_bnode_find+0x1f0/0xb5c fs/hfsplus/bnode.c:492 hfsplus_brec_find+0x128/0x448 fs/hfsplus/bfind.c:172 hfsplus_find_attr+0x164/0x234 fs/hfsplus/attributes.c:-1 __hfsplus_getxattr+0x2a0/0x6c4 fs/hfsplus/xattr.c:520 hfsplus_getxattr+0x100/0x168 fs/hfsplus/xattr.c:588 hfsplus_security_getxattr+0x48/0x5c fs/hfsplus/xattr_security.c:20 __vfs_getxattr+0x394/0x3c0 fs/xattr.c:423 smk_fetch+0xc4/0x150 security/smack/smack_lsm.c:289 smack_d_instantiate+0x53c/0x7a4 security/smack/smack_lsm.c:3606 security_d_instantiate+0x100/0x204 security/security.c:4079 d_splice_alias+0x70/0x31c fs/dcache.c:2997 hfsplus_lookup+0x6b4/0x728 fs/hfsplus/dir.c:124 lookup_one_qstr_excl_raw+0x10c/0x25c fs/namei.c:1689 lookup_one_qstr_excl fs/namei.c:1711 [inline] do_unlinkat+0x1a0/0x4dc fs/namei.c:4647 __do_sys_unlinkat fs/namei.c:4700 [inline] __se_sys_unlinkat fs/namei.c:4693 [inline] __arm64_sys_unlinkat+0xdc/0xf8 fs/namei.c:4693 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 The buggy address belongs to the object at ffff0000d23ff600 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 [ffff0000d23ff600, ffff0000d23ff698) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1123ff ksm flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000000 ffff0000c00013c0 fffffdffc3076e00 dead000000000003 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d23ff580: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d23ff600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000d23ff680: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000d23ff700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000d23ff780: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ------------[ cut here ]------------ WARNING: CPU: 1 PID: 7339 at ./include/linux/mm.h:2206 rcu_read_unlock_sched include/linux/rcupdate.h:955 [inline] WARNING: CPU: 1 PID: 7339 at ./include/linux/mm.h:2206 pfn_valid include/linux/mmzone.h:2160 [inline] WARNING: CPU: 1 PID: 7339 at ./include/linux/mm.h:2206 lowmem_page_address include/linux/mm.h:2206 [inline] WARNING: CPU: 1 PID: 7339 at ./include/linux/mm.h:2206 kmap_local_page+0x370/0x4ec include/linux/highmem-internal.h:188 Modules linked in: CPU: 1 UID: 0 PID: 7339 Comm: syz-executor Tainted: G B 6.16.0-rc6-syzkaller-gaaef6f251176 #0 PREEMPT Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : lowmem_page_address include/linux/rcupdate.h:955 [inline] pc : kmap_local_page+0x370/0x4ec include/linux/highmem-internal.h:188 lr : pfn_valid include/linux/mmzone.h:2152 [inline] lr : lowmem_page_address include/linux/mm.h:2206 [inline] lr : kmap_local_page+0x140/0x4ec include/linux/highmem-internal.h:188 sp : ffff8000a1d67470 x29: ffff8000a1d67470 x28: 0000000000000232 x27: 0000000000007232 x26: ffff80008ef79000 x25: 1ffff00011def2a0 x24: dfff800000000000 x23: 064e05dc41001cab x22: 0000000000000002 x21: 0000000000000002 x20: ffff0000d23ff600 x19: 0019381771040072 x18: 1fffe000337d6476 x17: 0000000000000000 x16: ffff80008af005d0 x15: 0000000000000001 x14: 1ffff000125db6f4 x13: 0000000000000000 x12: 0000000000000000 x11: ffff7000125db6f5 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : ffff0000d8f21e80 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000a1d66d38 x4 : ffff80008f776bc0 x3 : ffff8000803b7030 x2 : 0000000000000001 x1 : 0019381771040072 x0 : 0010000000000000 Call trace: rcu_read_unlock_sched include/linux/rcupdate.h:955 [inline] (P) pfn_valid include/linux/mmzone.h:2160 [inline] (P) lowmem_page_address include/linux/mm.h:2206 [inline] (P) kmap_local_page+0x370/0x4ec include/linux/highmem-internal.h:188 (P) memcpy_from_page include/linux/highmem.h:447 [inline] hfsplus_bnode_read+0xa4/0x1a8 fs/hfsplus/bnode.c:32 hfsplus_bnode_dump+0x274/0x384 fs/hfsplus/bnode.c:-1 hfsplus_brec_remove+0x3cc/0x4a0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x198/0x33c fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x228/0x390 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x82c/0xbb0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x2a8/0x63c fs/hfsplus/dir.c:385 vfs_unlink+0x2e0/0x520 fs/namei.c:4595 do_unlinkat+0x2f0/0x4dc fs/namei.c:4659 __do_sys_unlinkat fs/namei.c:4700 [inline] __se_sys_unlinkat fs/namei.c:4693 [inline] __arm64_sys_unlinkat+0xdc/0xf8 fs/namei.c:4693 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 irq event stamp: 3083 hardirqs last enabled at (3083): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (3083): [] _raw_spin_unlock_irqrestore+0x38/0x98 kernel/locking/spinlock.c:194 hardirqs last disabled at (3082): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (3082): [] _raw_spin_lock_irqsave+0x2c/0x7c kernel/locking/spinlock.c:162 softirqs last enabled at (3066): [] softirq_handle_end kernel/softirq.c:425 [inline] softirqs last enabled at (3066): [] handle_softirqs+0xaf8/0xc88 kernel/softirq.c:607 softirqs last disabled at (3045): [] __do_softirq+0x14/0x20 kernel/softirq.c:613 ---[ end trace 0000000000000000 ]--- Unable to handle kernel paging request at virtual address fff0771000072cf2 KASAN: maybe wild-memory-access in range [0xff87b88000396790-0xff87b88000396797] Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000207157000 [fff0771000072cf2] pgd=180000023ffff403, p4d=0000000000000000 Internal error: Oops: 0000000096000004 [#1] SMP Modules linked in: CPU: 1 UID: 0 PID: 7339 Comm: syz-executor Tainted: G B W 6.16.0-rc6-syzkaller-gaaef6f251176 #0 PREEMPT Tainted: [B]=BAD_PAGE, [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __pi_memcpy_generic+0x70/0x22c arch/arm64/lib/memcpy.S:100 lr : __asan_memcpy+0x68/0x84 mm/kasan/shadow.c:109 sp : ffff8000a1d67490 x29: ffff8000a1d67490 x28: 0000000000000232 x27: 0000000000007232 x26: 0000000000000002 x25: dfff800000000000 x24: 0000000000000234 x23: fff0771000072ac0 x22: ffff8000812aa99c x21: ffff8000a1d67560 x20: fff0771000072cf2 x19: 0000000000000002 x18: 1fffe000337d6476 x17: 0000000000000000 x16: ffff80008af005d0 x15: ffff7000143aceac x14: 0000000000000001 x13: 0000000000000002 x12: ffffffffffffffff x11: ffff7000143aceac x10: dfff800000000000 x9 : 0000000000000002 x8 : 0000000000000001 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000a1d67562 x4 : fff0771000072cf4 x3 : ffff8000812aa99c x2 : 0000000000000002 x1 : fff0771000072cf2 x0 : ffff8000a1d67560 Call trace: __pi_memcpy_generic+0x70/0x22c arch/arm64/lib/memcpy.S:99 (P) memcpy_from_page include/linux/highmem.h:450 [inline] hfsplus_bnode_read+0xd0/0x1a8 fs/hfsplus/bnode.c:32 hfsplus_bnode_dump+0x274/0x384 fs/hfsplus/bnode.c:-1 hfsplus_brec_remove+0x3cc/0x4a0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x198/0x33c fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x228/0x390 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x82c/0xbb0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x2a8/0x63c fs/hfsplus/dir.c:385 vfs_unlink+0x2e0/0x520 fs/namei.c:4595 do_unlinkat+0x2f0/0x4dc fs/namei.c:4659 __do_sys_unlinkat fs/namei.c:4700 [inline] __se_sys_unlinkat fs/namei.c:4693 [inline] __arm64_sys_unlinkat+0xdc/0xf8 fs/namei.c:4693 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 Code: b81fc0a8 d65f03c0 b4000102 d341fc4e (39400026) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: b81fc0a8 stur w8, [x5, #-4] 4: d65f03c0 ret 8: b4000102 cbz x2, 0x28 c: d341fc4e lsr x14, x2, #1 * 10: 39400026 ldrb w6, [x1] <-- trapping instruction