syzbot


KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key

Status: upstream: reported C repro on 2024/01/30 17:02
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+9e980ae625534d4b4e41@syzkaller.appspotmail.com
First crash: 286d, last: 162d
Fix bisection: failed (error log, bisect log)
  
Bug presence (1)
Date Name Commit Repro Result
2024/01/30 upstream (ToT) 861c0981648f C [report] KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key hfs C inconclusive 9 1d15h 283d 0/28 upstream: reported C repro on 2024/02/03 08:40
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/07/14 00:53 14m bisect fix linux-6.1.y error job log
2024/05/19 15:41 1h36m bisect fix linux-6.1.y OK (0) job log log
2024/03/09 03:15 1h34m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
loop0: detected capacity change from 0 to 1024
==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy_from_page include/linux/highmem.h:393 [inline]
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_key+0x3bc/0x658 fs/hfsplus/bnode.c:70
Write of size 3970 at addr ffff0000d553f800 by task syz-executor408/4228

CPU: 0 PID: 4228 Comm: syz-executor408 Not tainted 6.1.92-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x174/0x4c0 mm/kasan/report.c:395
 kasan_report+0xd4/0x130 mm/kasan/report.c:495
 kasan_check_range+0x264/0x2a4 mm/kasan/generic.c:189
 memcpy+0x60/0x90 mm/kasan/shadow.c:66
 memcpy_from_page include/linux/highmem.h:393 [inline]
 hfsplus_bnode_read fs/hfsplus/bnode.c:32 [inline]
 hfsplus_bnode_read_key+0x3bc/0x658 fs/hfsplus/bnode.c:70
 hfsplus_brec_insert+0x520/0xaa0 fs/hfsplus/brec.c:141
 hfsplus_create_attr+0x3b0/0x568 fs/hfsplus/attributes.c:252
 __hfsplus_setxattr+0x990/0x1d10 fs/hfsplus/xattr.c:354
 hfsplus_setxattr+0xb4/0xec fs/hfsplus/xattr.c:434
 hfsplus_security_setxattr+0x54/0x6c fs/hfsplus/xattr_security.c:31
 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182
 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216
 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277
 vfs_setxattr+0x1a8/0x344 fs/xattr.c:309
 do_setxattr fs/xattr.c:594 [inline]
 setxattr+0x230/0x294 fs/xattr.c:617
 path_setxattr+0x17c/0x258 fs/xattr.c:636
 __do_sys_setxattr fs/xattr.c:652 [inline]
 __se_sys_setxattr fs/xattr.c:648 [inline]
 __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:648
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 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 4228:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:955 [inline]
 __kmalloc+0xd8/0x1c4 mm/slab_common.c:968
 kmalloc include/linux/slab.h:561 [inline]
 hfsplus_find_init+0x84/0x1bc fs/hfsplus/bfind.c:21
 hfsplus_create_attr+0x14c/0x568 fs/hfsplus/attributes.c:216
 __hfsplus_setxattr+0x990/0x1d10 fs/hfsplus/xattr.c:354
 hfsplus_setxattr+0xb4/0xec fs/hfsplus/xattr.c:434
 hfsplus_security_setxattr+0x54/0x6c fs/hfsplus/xattr_security.c:31
 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182
 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216
 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277
 vfs_setxattr+0x1a8/0x344 fs/xattr.c:309
 do_setxattr fs/xattr.c:594 [inline]
 setxattr+0x230/0x294 fs/xattr.c:617
 path_setxattr+0x17c/0x258 fs/xattr.c:636
 __do_sys_setxattr fs/xattr.c:652 [inline]
 __se_sys_setxattr fs/xattr.c:648 [inline]
 __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:648
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 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 ffff0000d553f800
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 0 bytes inside of
 1024-byte region [ffff0000d553f800, ffff0000d553fc00)

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

Memory state around the buggy address:
 ffff0000d553f900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000d553f980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000d553fa00: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
                            ^
 ffff0000d553fa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000d553fb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/02 10:02 linux-6.1.y 88690811da69 3113787f .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 Write in hfsplus_bnode_read_key
2024/01/30 17:16 linux-6.1.y 883d1a956208 7f400fcb .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
2024/04/14 15:35 linux-6.1.y cd5d98c0556c c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
2024/03/27 02:16 linux-6.1.y e5cd595e23c1 454571b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
2024/03/11 18:56 linux-6.1.y 61adba85cc40 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
2024/04/05 03:08 linux-6.1.y 347385861c50 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
2024/04/05 03:07 linux-6.1.y 347385861c50 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
2024/03/27 02:48 linux-6.1.y e5cd595e23c1 454571b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
2024/03/24 18:40 linux-6.1.y d7543167affd 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
2024/01/30 17:02 linux-6.1.y 883d1a956208 7f400fcb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Write in hfsplus_bnode_read_key
* Struck through repros no longer work on HEAD.