syzbot


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

Status: upstream: reported C repro on 2022/11/26 08:07
Subsystems: hfs
[Documentation on labels]
Reported-by: syzbot+e76bf3d19b85350571ac@syzkaller.appspotmail.com
First crash: 368d, last: 7d12h
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] KASAN: slab-out-of-bounds Read in hfsplus_bnode_read 0 (1) 2022/11/26 08:07
Similar bugs (3)
Kernel Title 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 C 2 13d 161d 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 C error 2 366d 367d 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 C 3 269d 361d 0/1 upstream: reported C repro on 2022/12/03 05:45
Last patch testing requests (10)
Created Duration User Patch Repo Result
2023/11/21 18:18 14m retest repro upstream report log
2023/11/21 17:22 20m retest repro linux-next OK log
2023/11/21 17:22 20m retest repro linux-next OK log
2023/11/21 17:04 11m retest repro upstream report log
2023/11/21 17:04 14m retest repro upstream report log
2023/11/21 17:04 10m retest repro upstream report log
2023/11/07 11:42 15m retest repro upstream report log
2023/11/07 11:42 13m retest repro upstream report log
2023/11/07 11:42 13m retest repro upstream report log
2023/11/07 11:42 13m retest repro upstream report log
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2023/08/01 14:02 1h36m bisect fix upstream job log (0) log
2023/06/01 22:38 25m bisect fix upstream job log (0) log
2023/05/02 20:34 1h00m bisect fix upstream job log (0) log
2023/04/02 11:08 38m bisect fix upstream job log (0) log
2023/03/03 10:30 38m bisect fix upstream job log (0) log
2023/02/01 06:21 27m bisect fix upstream job log (0) log

Sample crash report:
memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=4999 'syz-executor358'
loop0: detected capacity change from 0 to 1024
hfsplus: request for non-existent node 32768 in B*Tree
hfsplus: request for non-existent node 32768 in B*Tree
==================================================================
BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x144/0x150 fs/hfsplus/bnode.c:32
Read of size 8 at addr ffff88814bec30c0 by task syz-executor358/4999

CPU: 1 PID: 4999 Comm: syz-executor358 Not tainted 6.4.0-syzkaller-00082-gc0a572d9d32f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351
 print_report mm/kasan/report.c:462 [inline]
 kasan_report+0x11c/0x130 mm/kasan/report.c:572
 hfsplus_bnode_read+0x144/0x150 fs/hfsplus/bnode.c:32
 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline]
 hfsplus_bnode_dump+0x2c6/0x3a0 fs/hfsplus/bnode.c:321
 hfsplus_brec_remove+0x3db/0x4f0 fs/hfsplus/brec.c:229
 __hfsplus_delete_attr+0x28a/0x3a0 fs/hfsplus/attributes.c:299
 hfsplus_delete_all_attrs+0x25d/0x320 fs/hfsplus/attributes.c:378
 hfsplus_delete_cat+0x86a/0xe40 fs/hfsplus/catalog.c:425
 hfsplus_unlink+0x1e3/0x830 fs/hfsplus/dir.c:385
 vfs_unlink+0x355/0x930 fs/namei.c:4329
 do_unlinkat+0x3e3/0x680 fs/namei.c:4395
 __do_sys_unlink fs/namei.c:4443 [inline]
 __se_sys_unlink fs/namei.c:4441 [inline]
 __x64_sys_unlink+0xca/0x110 fs/namei.c:4441
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f06268e4789
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffc8df90e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000057
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f06268e4789
RDX: 00007f06268a2e03 RSI: 0000000000000000 RDI: 0000000020000140
RBP: 00007f06268a4020 R08: 0000000000000640 R09: 0000000000000000
R10: 00007fffc8df8fb0 R11: 0000000000000246 R12: 00007f06268a40b0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Allocated by task 4999:
 kasan_save_stack+0x22/0x40 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 mm/kasan/common.c:333 [inline]
 __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:196 [inline]
 __do_kmalloc_node mm/slab_common.c:966 [inline]
 __kmalloc+0x5e/0x190 mm/slab_common.c:979
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:680 [inline]
 __hfs_bnode_create+0x107/0x840 fs/hfsplus/bnode.c:409
 hfsplus_bnode_find+0x41c/0xc60 fs/hfsplus/bnode.c:486
 hfsplus_brec_find+0x2b3/0x520 fs/hfsplus/bfind.c:183
 hfsplus_find_attr fs/hfsplus/attributes.c:160 [inline]
 hfsplus_delete_all_attrs+0x236/0x320 fs/hfsplus/attributes.c:371
 hfsplus_delete_cat+0x86a/0xe40 fs/hfsplus/catalog.c:425
 hfsplus_unlink+0x1e3/0x830 fs/hfsplus/dir.c:385
 vfs_unlink+0x355/0x930 fs/namei.c:4329
 do_unlinkat+0x3e3/0x680 fs/namei.c:4395
 __do_sys_unlink fs/namei.c:4443 [inline]
 __se_sys_unlink fs/namei.c:4441 [inline]
 __x64_sys_unlink+0xca/0x110 fs/namei.c:4441
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Last potentially related work creation:
 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491
 insert_work+0x48/0x360 kernel/workqueue.c:1368
 __queue_work+0x625/0x1120 kernel/workqueue.c:1529
 queue_work_on+0xf2/0x110 kernel/workqueue.c:1557
 queue_work include/linux/workqueue.h:506 [inline]
 call_usermodehelper_exec+0x1d2/0x4c0 kernel/umh.c:434
 kobject_uevent_env+0xefc/0x16c0 lib/kobject_uevent.c:618
 kernel_add_sysfs_param kernel/params.c:817 [inline]
 param_sysfs_builtin kernel/params.c:852 [inline]
 param_sysfs_builtin_init+0x21d/0x460 kernel/params.c:986
 do_one_initcall+0x102/0x540 init/main.c:1246
 do_initcall_level init/main.c:1319 [inline]
 do_initcalls init/main.c:1335 [inline]
 do_basic_setup init/main.c:1354 [inline]
 kernel_init_freeable+0x64e/0xba0 init/main.c:1571
 kernel_init+0x1e/0x2c0 init/main.c:1462
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

The buggy address belongs to the object at ffff88814bec3000
 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 [ffff88814bec3000, ffff88814bec3098)

The buggy address belongs to the physical page:
page:ffffea00052fb0c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14bec3
anon flags: 0x57ff00000000200(slab|node=1|zone=2|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 057ff00000000200 ffff888012441a00 0000000000000000 0000000000000001
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 9293238004, free_ts 0
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731
 prep_new_page mm/page_alloc.c:1738 [inline]
 get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502
 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768
 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2112
 alloc_pages+0x233/0x270 mm/mempolicy.c:2274
 alloc_slab_page mm/slub.c:1851 [inline]
 allocate_slab+0x25f/0x390 mm/slub.c:1998
 new_slab mm/slub.c:2051 [inline]
 ___slab_alloc+0xa91/0x1400 mm/slub.c:3192
 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291
 __slab_alloc_node mm/slub.c:3344 [inline]
 slab_alloc_node mm/slub.c:3441 [inline]
 __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3490
 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1057
 kmalloc include/linux/slab.h:559 [inline]
 kzalloc include/linux/slab.h:680 [inline]
 call_usermodehelper_setup+0x9c/0x340 kernel/umh.c:363
 kobject_uevent_env+0xedd/0x16c0 lib/kobject_uevent.c:614
 kernel_add_sysfs_param kernel/params.c:817 [inline]
 param_sysfs_builtin kernel/params.c:852 [inline]
 param_sysfs_builtin_init+0x21d/0x460 kernel/params.c:986
 do_one_initcall+0x102/0x540 init/main.c:1246
 do_initcall_level init/main.c:1319 [inline]
 do_initcalls init/main.c:1335 [inline]
 do_basic_setup init/main.c:1354 [inline]
 kernel_init_freeable+0x64e/0xba0 init/main.c:1571
 kernel_init+0x1e/0x2c0 init/main.c:1462
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88814bec2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88814bec3000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88814bec3080: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
                                           ^
 ffff88814bec3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88814bec3180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/27 08:21 upstream c0a572d9d32f 4cd5bb25 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2023/06/15 22:08 upstream b6dad5178cea 757d26ed .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2023/06/06 14:28 upstream f8dba31b0a82 a4ae4f42 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2022/12/12 23:20 upstream 830b3c68c1fb 67be1ae7 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2022/12/11 04:46 upstream 296a7b7eb792 67be1ae7 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2022/11/27 20:03 upstream faf68e3523c2 f4470a7b .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2022/11/25 22:12 upstream 08ad43d554ba f4470a7b .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2023/08/08 07:49 upstream a027b2eca0b7 b1b6ae3d .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-selinux-root general protection fault in hfsplus_bnode_read
2022/12/24 23:35 upstream 72a85e2b0a1e 9da18ae8 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: wild-memory-access Read in hfsplus_bnode_read
2023/08/13 06:04 linux-next 21ef7b1e17d0 39990d51 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2023/08/06 18:10 linux-next bdffb18b5dd8 4ffcc9ef .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2023/11/07 16:54 upstream be3ca57cfb77 83211397 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2023/10/10 10:10 upstream 94f6f0550c62 c9be5398 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2023/06/06 14:11 upstream f8dba31b0a82 a4ae4f42 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
2022/11/27 16:50 upstream faf68e3523c2 f4470a7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in hfsplus_bnode_read
* Struck through repros no longer work on HEAD.