syzbot


KASAN: slab-out-of-bounds Read in hfsplus_bnode_read

Status: upstream: reported C repro on 2025/03/04 05:56
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+4c6680758f5b535c27ee@syzkaller.appspotmail.com
First crash: 127d, last: 16d
Bug presence (1)
Date Name Commit Repro Result
2025/03/25 upstream (ToT) 2df0c02dab82 C [report] KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read origin:upstream 23 C 70 3d05h 750d 0/3 upstream: reported C repro on 2023/06/20 20:03
linux-4.19 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read 17 C error 2 955d 956d 0/1 upstream: reported C repro on 2022/11/26 10:26
linux-4.14 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read hfsplus 17 C 3 858d 949d 0/1 upstream: reported C repro on 2022/12/03 05:45
upstream KASAN: slab-out-of-bounds Read in hfsplus_bnode_read hfs 23 C error 451 10h04m 956d 0/29 upstream: reported C repro on 2022/11/26 08:07

Sample crash report:
loop0: detected capacity change from 0 to 1024
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+0x9c/0x248 fs/hfsplus/bnode.c:32
Read of size 8 at addr ffff0000c08614c0 by task syz-executor202/4294

CPU: 0 PID: 4294 Comm: syz-executor202 Not tainted 6.1.141-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 print_address_description+0x88/0x220 mm/kasan/report.c:316
 print_report+0x50/0x68 mm/kasan/report.c:427
 kasan_report+0xa8/0x100 mm/kasan/report.c:531
 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
 hfsplus_bnode_read+0x9c/0x248 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+0x204/0x33c fs/hfsplus/attributes.c:378
 hfsplus_delete_cat+0x844/0xbb0 fs/hfsplus/catalog.c:425
 hfsplus_unlink+0x2a0/0x664 fs/hfsplus/dir.c:385
 vfs_unlink+0x2e0/0x4f4 fs/namei.c:4322
 do_unlinkat+0x31c/0x4e8 fs/namei.c:4390
 __do_sys_unlinkat fs/namei.c:4433 [inline]
 __se_sys_unlinkat fs/namei.c:4426 [inline]
 __arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4426
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Allocated by task 4294:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc+0xec/0x178 mm/slab_common.c:949
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 __hfs_bnode_create+0xe4/0x6cc fs/hfsplus/bnode.c:415
 hfsplus_bnode_find+0x1f0/0xb78 fs/hfsplus/bnode.c:492
 hfsplus_brec_find+0x128/0x448 fs/hfsplus/bfind.c:172
 hfsplus_find_attr fs/hfsplus/attributes.c:160 [inline]
 hfsplus_delete_all_attrs+0x1e0/0x33c fs/hfsplus/attributes.c:371
 hfsplus_delete_cat+0x844/0xbb0 fs/hfsplus/catalog.c:425
 hfsplus_unlink+0x2a0/0x664 fs/hfsplus/dir.c:385
 vfs_unlink+0x2e0/0x4f4 fs/namei.c:4322
 do_unlinkat+0x31c/0x4e8 fs/namei.c:4390
 __do_sys_unlinkat fs/namei.c:4433 [inline]
 __se_sys_unlinkat fs/namei.c:4426 [inline]
 __arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4426
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Last potentially related work creation:
 kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
 call_rcu+0xfc/0x948 kernel/rcu/tree.c:2845
 free_fib_info+0x68/0xa8 net/ipv4/fib_semantics.c:257
 fib_create_info+0x144c/0x1e58 net/ipv4/fib_semantics.c:1591
 fib_table_insert+0xac/0x1368 net/ipv4/fib_trie.c:1217
 fib_magic+0x250/0x31c net/ipv4/fib_frontend.c:1118
 fib_add_ifaddr+0x2ec/0x4f8 net/ipv4/fib_frontend.c:1155
 fib_netdev_event+0x360/0x4a4 net/ipv4/fib_frontend.c:1500
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:455
 call_netdevice_notifiers_info net/core/dev.c:2001 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
 call_netdevice_notifiers net/core/dev.c:2053 [inline]
 __dev_notify_flags+0x250/0x46c net/core/dev.c:-1
 dev_change_flags+0xc8/0x154 net/core/dev.c:8702
 devinet_ioctl+0x88c/0x17e0 net/ipv4/devinet.c:1157
 inet_ioctl+0x304/0x4d8 net/ipv4/af_inet.c:1008
 sock_do_ioctl+0xf8/0x240 net/socket.c:1204
 sock_ioctl+0x5c4/0x840 net/socket.c:1321
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the object at ffff0000c0861400
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 192 bytes inside of
 256-byte region [ffff0000c0861400, ffff0000c0861500)

The buggy address belongs to the physical page:
page:00000000c4e34fcb refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x100860
head:00000000c4e34fcb order:1 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc0003575c00 dead000000000004 ffff0000c0002480
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000c0861380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000c0861400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000c0861480: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
                                           ^
 ffff0000c0861500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000c0861580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
Unable to handle kernel paging request at virtual address ffff74f8000087ff
KASAN: maybe wild-memory-access in range [0xffffa7c000043ff8-0xffffa7c000043fff]
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
  CM = 0, WnR = 0
swapper pgtable: 4k pages, 48-bit VAs, pgdp=000000020e41a000
[ffff74f8000087ff] pgd=0000000000000000, p4d=0000000000000000
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 4294 Comm: syz-executor202 Tainted: G    B              6.1.141-syzkaller #0
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 : bytes_is_nonzero mm/kasan/generic.c:85 [inline]
pc : memory_is_nonzero mm/kasan/generic.c:102 [inline]
pc : memory_is_poisoned_n mm/kasan/generic.c:128 [inline]
pc : memory_is_poisoned mm/kasan/generic.c:159 [inline]
pc : check_region_inline mm/kasan/generic.c:180 [inline]
pc : kasan_check_range+0x64/0x2a0 mm/kasan/generic.c:189
lr : memcpy+0x48/0x90 mm/kasan/shadow.c:65
sp : ffff800020737470
x29: ffff800020737470 x28: 0000000000000001 x27: 0000000040000000
x26: 1ffff0000295206c x25: dfff800000000000 x24: 0000000000001000
x23: 0000000000000001 x22: ffff800008f68cb4 x21: ffff800020737560
x20: ffffa7c000043fff x19: 0000000000000001 x18: ffff800011a7bce0
x17: 1fffe00033ee7176 x16: ffff800008042940 x15: 0000000000000000
x14: 00000000000000ff x13: 0000000000ff0100 x12: 0000000000000001
x11: 1ffff4f8000087ff x10: 1ffff4f8000087ff x9 : ffffffffffffffff
x8 : ffff74f8000087ff x7 : 0000000000000004 x6 : 00000000000000ff
x5 : ffff800020737582 x4 : ffff0000e415b00c x3 : ffff800008f68cb4
x2 : 0000000000000000 x1 : 0000000000000001 x0 : ffffa7c000043fff
Call trace:
 bytes_is_nonzero mm/kasan/generic.c:84 [inline]
 memory_is_nonzero mm/kasan/generic.c:102 [inline]
 memory_is_poisoned_n mm/kasan/generic.c:128 [inline]
 memory_is_poisoned mm/kasan/generic.c:159 [inline]
 check_region_inline mm/kasan/generic.c:180 [inline]
 kasan_check_range+0x64/0x2a0 mm/kasan/generic.c:189
 memcpy+0x48/0x90 mm/kasan/shadow.c:65
 memcpy_from_page include/linux/highmem.h:393 [inline]
 hfsplus_bnode_read+0x124/0x248 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+0x204/0x33c fs/hfsplus/attributes.c:378
 hfsplus_delete_cat+0x844/0xbb0 fs/hfsplus/catalog.c:425
 hfsplus_unlink+0x2a0/0x664 fs/hfsplus/dir.c:385
 vfs_unlink+0x2e0/0x4f4 fs/namei.c:4322
 do_unlinkat+0x31c/0x4e8 fs/namei.c:4390
 __do_sys_unlinkat fs/namei.c:4433 [inline]
 __se_sys_unlinkat fs/namei.c:4426 [inline]
 __arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4426
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
Code: 5400014c b4000b8c aa2a03e9 8b0b0129 (3940010a) 
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
   0:	5400014c 	b.gt	0x28
   4:	b4000b8c 	cbz	x12, 0x174
   8:	aa2a03e9 	mvn	x9, x10
   c:	8b0b0129 	add	x9, x9, x11
* 10:	3940010a 	ldrb	w10, [x8] <-- trapping instruction

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/23 13:25 linux-6.1.y 58485ff1a74f d6cdfb8a .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/05/18 05:42 linux-6.1.y 02b72ccb5f9d f41472b0 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/04 10:20 linux-6.1.y 3a8358583626 c3901742 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/04 09:17 linux-6.1.y 3a8358583626 c3901742 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/04 08:05 linux-6.1.y 3a8358583626 c3901742 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/04 07:02 linux-6.1.y 3a8358583626 c3901742 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/06/10 00:31 linux-6.1.y 58485ff1a74f 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/05/03 17:05 linux-6.1.y b6736e03756f b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/04/15 08:01 linux-6.1.y 420102835862 0bd6db41 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/04/08 06:54 linux-6.1.y 3dfebb87d7eb a2ada0e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/04/06 22:30 linux-6.1.y 8e60a714ba3b 1c65791e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/30 17:34 linux-6.1.y 8e60a714ba3b d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/21 07:33 linux-6.1.y 344a09659766 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/17 02:09 linux-6.1.y 344a09659766 e2826670 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/07 06:26 linux-6.1.y 3a8358583626 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2025/03/04 05:55 linux-6.1.y 3a8358583626 c3901742 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
* Struck through repros no longer work on HEAD.