hfsplus: request for non-existent node 393216 in B*Tree hfsplus: request for non-existent node 393216 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read fs/hfsplus/bnode.c:32 [inline] BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_dump+0x454/0xa8c fs/hfsplus/bnode.c:321 Read of size 8 at addr ffff0000c9ed0bc0 by task syz.8.410/9475 CPU: 1 UID: 0 PID: 9475 Comm: syz.8.410 Not tainted 6.13.0-rc2-syzkaller-g2e7aff49b5da #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x198/0x538 mm/kasan/report.c:489 kasan_report+0xd8/0x138 mm/kasan/report.c:602 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 hfsplus_bnode_read fs/hfsplus/bnode.c:32 [inline] hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x454/0xa8c fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x3d0/0x4a4 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x1dc/0x3e4 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x214/0x348 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x98c/0xd6c fs/hfsplus/catalog.c:425 hfsplus_unlink+0x2d0/0x690 fs/hfsplus/dir.c:385 vfs_unlink+0x2f0/0x534 fs/namei.c:4523 do_unlinkat+0x4d0/0x700 fs/namei.c:4587 __do_sys_unlinkat fs/namei.c:4630 [inline] __se_sys_unlinkat fs/namei.c:4623 [inline] __arm64_sys_unlinkat+0xc8/0xf8 fs/namei.c:4623 __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+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Allocated by task 9475: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:568 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4283 [inline] __kmalloc_noprof+0x32c/0x54c mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] __hfs_bnode_create+0xe4/0x6d4 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x200/0xe60 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x134/0x4a0 fs/hfsplus/bfind.c:172 hfsplus_find_attr+0x1e0/0x33c __hfsplus_getxattr+0x2b8/0x870 fs/hfsplus/xattr.c:520 hfsplus_getxattr+0xac/0xe4 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+0xc8/0x150 security/smack/smack_lsm.c:306 smack_d_instantiate+0x594/0x880 security/smack/smack_lsm.c:3615 security_d_instantiate+0x100/0x204 security/security.c:4070 d_splice_alias+0x70/0x310 fs/dcache.c:3001 hfsplus_lookup+0x8e4/0x98c fs/hfsplus/dir.c:124 lookup_one_qstr_excl+0x108/0x230 fs/namei.c:1692 do_unlinkat+0x2fc/0x700 fs/namei.c:4575 __do_sys_unlinkat fs/namei.c:4630 [inline] __se_sys_unlinkat fs/namei.c:4623 [inline] __arm64_sys_unlinkat+0xc8/0xf8 fs/namei.c:4623 __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+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the object at ffff0000c9ed0b00 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 [ffff0000c9ed0b00, ffff0000c9ed0b98) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109ed0 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000000 ffff0000c00013c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c9ed0a80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000c9ed0b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000c9ed0b80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000c9ed0c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000c9ed0c80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ------------[ cut here ]------------ WARNING: CPU: 0 PID: 9475 at ./include/linux/mm.h:2249 rcu_read_unlock_sched include/linux/rcupdate.h:964 [inline] WARNING: CPU: 0 PID: 9475 at ./include/linux/mm.h:2249 pfn_valid include/linux/mmzone.h:2050 [inline] WARNING: CPU: 0 PID: 9475 at ./include/linux/mm.h:2249 lowmem_page_address include/linux/mm.h:2249 [inline] WARNING: CPU: 0 PID: 9475 at ./include/linux/mm.h:2249 kmap_local_page+0x354/0x4c0 include/linux/highmem-internal.h:180 Modules linked in: CPU: 0 UID: 0 PID: 9475 Comm: syz.8.410 Tainted: G B 6.13.0-rc2-syzkaller-g2e7aff49b5da #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : lowmem_page_address include/linux/rcupdate.h:964 [inline] pc : kmap_local_page+0x354/0x4c0 include/linux/highmem-internal.h:180 lr : pfn_valid include/linux/mmzone.h:2042 [inline] lr : lowmem_page_address include/linux/mm.h:2249 [inline] lr : kmap_local_page+0xa4/0x4c0 include/linux/highmem-internal.h:180 sp : ffff80009f4273b0 x29: ffff80009f4273b0 x28: ffff0000c9ed0b88 x27: 0000000000000232 x26: 0000000000000080 x25: 000000000000f040 x24: 0000000000001000 x23: ffff80008f2ab000 x22: 1ffff00011e557fc x21: 0000000000000002 x20: ffff0000c9ed0bc0 x19: 050006a741002503 x18: 0000000000000008 x17: 0000000000000000 x16: ffff80008b5e791c x15: 0000000000000001 x14: 1ffff000125cfaf0 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000080000 x10: 000000000007ffff x9 : ffff80009dfe9000 x8 : 0000000000080000 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80009f426a38 x4 : ffff80008fa6f860 x3 : ffff8000802f42d0 x2 : 0000000000000001 x1 : 050006a741002503 x0 : 0400000000000000 Call trace: rcu_read_unlock_sched include/linux/rcupdate.h:964 [inline] (P) pfn_valid include/linux/mmzone.h:2050 [inline] (P) lowmem_page_address include/linux/mm.h:2249 [inline] (P) kmap_local_page+0x354/0x4c0 include/linux/highmem-internal.h:180 (P) pfn_valid include/linux/mmzone.h:2042 [inline] (L) lowmem_page_address include/linux/mm.h:2249 [inline] (L) kmap_local_page+0xa4/0x4c0 include/linux/highmem-internal.h:180 (L) memcpy_from_page include/linux/highmem.h:414 [inline] hfsplus_bnode_read fs/hfsplus/bnode.c:32 [inline] hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x45c/0xa8c fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x3d0/0x4a4 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x1dc/0x3e4 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x214/0x348 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x98c/0xd6c fs/hfsplus/catalog.c:425 hfsplus_unlink+0x2d0/0x690 fs/hfsplus/dir.c:385 vfs_unlink+0x2f0/0x534 fs/namei.c:4523 do_unlinkat+0x4d0/0x700 fs/namei.c:4587 __do_sys_unlinkat fs/namei.c:4630 [inline] __se_sys_unlinkat fs/namei.c:4623 [inline] __arm64_sys_unlinkat+0xc8/0xf8 fs/namei.c:4623 __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+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 irq event stamp: 4575 hardirqs last enabled at (4575): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1526 [inline] hardirqs last enabled at (4575): [] finish_lock_switch+0xbc/0x1e4 kernel/sched/core.c:5123 hardirqs last disabled at (4574): [] __schedule+0x2bc/0x27f0 kernel/sched/core.c:6660 softirqs last enabled at (4392): [] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (4392): [] handle_softirqs+0xb44/0xd34 kernel/softirq.c:582 softirqs last disabled at (4209): [] __do_softirq+0x14/0x20 kernel/softirq.c:588 ---[ end trace 0000000000000000 ]--- Unable to handle kernel paging request at virtual address ffff700200000207 KASAN: probably wild-memory-access in range [0xffff801000001038-0xffff80100000103f] Mem abort info: ESR = 0x0000000096000005 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x05: level 1 translation fault Data abort info: ISV = 0, ISS = 0x00000005, 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=00000001a587b000 [ffff700200000207] pgd=0000000000000000, p4d=000000023e888003, pud=0000000000000000 Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP Modules linked in: CPU: 0 UID: 0 PID: 9475 Comm: syz.8.410 Tainted: G B W 6.13.0-rc2-syzkaller-g2e7aff49b5da #0 Tainted: [B]=BAD_PAGE, [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : bytes_is_nonzero mm/kasan/generic.c:87 [inline] pc : memory_is_nonzero mm/kasan/generic.c:104 [inline] pc : memory_is_poisoned_n mm/kasan/generic.c:129 [inline] pc : memory_is_poisoned mm/kasan/generic.c:161 [inline] pc : check_region_inline mm/kasan/generic.c:180 [inline] pc : kasan_check_range+0x78/0x2a8 mm/kasan/generic.c:189 lr : __asan_memcpy+0x3c/0x84 mm/kasan/shadow.c:105 sp : ffff80009f4273c0 x29: ffff80009f4273c0 x28: ffff0000c9ed0b80 x27: 0000000000000002 x26: ffff801000000040 x25: 000000000000efff x24: 0000000000001000 x23: ffff80009f4274b0 x22: ffff8000812c6f8c x21: ffff80009f4274b0 x20: ffff80100000103e x19: 0000000000000002 x18: 0000000000000008 x17: 0000000000000000 x16: ffff80008326d65c x15: 0000000000000001 x14: 1ffff00200000207 x13: 00000000000000ff x12: ffffffffffffffff x11: ffff700200000207 x10: 1ffff00200000207 x9 : dfff800000000000 x8 : ffff80100000103f x7 : 0000000000000001 x6 : ffff8000812ca1b4 x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000812c6f8c x2 : 0000000000000000 x1 : 0000000000000002 x0 : ffff80100000103e Call trace: bytes_is_nonzero mm/kasan/generic.c:86 [inline] (P) memory_is_nonzero mm/kasan/generic.c:104 [inline] (P) memory_is_poisoned_n mm/kasan/generic.c:129 [inline] (P) memory_is_poisoned mm/kasan/generic.c:161 [inline] (P) check_region_inline mm/kasan/generic.c:180 [inline] (P) kasan_check_range+0x78/0x2a8 mm/kasan/generic.c:189 (P) __asan_memcpy+0x3c/0x84 mm/kasan/shadow.c:105 (L) __asan_memcpy+0x3c/0x84 mm/kasan/shadow.c:105 memcpy_from_page include/linux/highmem.h:417 [inline] hfsplus_bnode_read fs/hfsplus/bnode.c:32 [inline] hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x344/0xa8c fs/hfsplus/bnode.c:305 hfsplus_brec_remove+0x3d0/0x4a4 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x1dc/0x3e4 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x214/0x348 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x98c/0xd6c fs/hfsplus/catalog.c:425 hfsplus_unlink+0x2d0/0x690 fs/hfsplus/dir.c:385 vfs_unlink+0x2f0/0x534 fs/namei.c:4523 do_unlinkat+0x4d0/0x700 fs/namei.c:4587 __do_sys_unlinkat fs/namei.c:4630 [inline] __se_sys_unlinkat fs/namei.c:4623 [inline] __arm64_sys_unlinkat+0xc8/0xf8 fs/namei.c:4623 __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+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Code: 5400014c b4000b8f aa2a03ec 8b0e018c (3940016d) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: 5400014c b.gt 0x28 4: b4000b8f cbz x15, 0x174 8: aa2a03ec mvn x12, x10 c: 8b0e018c add x12, x12, x14 * 10: 3940016d ldrb w13, [x11] <-- trapping instruction