hfsplus: request for non-existent node 184549376 in B*Tree hfsplus: request for non-existent node 184549376 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x22a/0x240 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff88801aab0fc0 by task syz-executor.0/5427 CPU: 1 PID: 5427 Comm: syz-executor.0 Not tainted 6.10.0-rc6-syzkaller-00210-gd270dd21bee0 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 hfsplus_bnode_read+0x22a/0x240 fs/hfsplus/bnode.c:32 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x2a2/0x3e0 fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x3e2/0x4f0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x2a2/0x3b0 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x271/0x330 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x844/0xdd0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x213/0x7f0 fs/hfsplus/dir.c:385 vfs_unlink+0x2fb/0x9b0 fs/namei.c:4349 do_unlinkat+0x5c0/0x750 fs/namei.c:4413 __do_sys_unlink fs/namei.c:4461 [inline] __se_sys_unlink fs/namei.c:4459 [inline] __x64_sys_unlink+0xc7/0x110 fs/namei.c:4459 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f42a267dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f42a347e0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 00007f42a27abf80 RCX: 00007f42a267dda9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 RBP: 00007f42a26ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f42a27abf80 R15: 00007ffc75185e28 Allocated by task 5427: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4123 [inline] __kmalloc_noprof+0x1ec/0x410 mm/slub.c:4136 kmalloc_noprof include/linux/slab.h:664 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] __hfs_bnode_create+0x108/0x870 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x2c8/0xcb0 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x2b9/0x520 fs/hfsplus/bfind.c:183 hfsplus_find_attr fs/hfsplus/attributes.c:160 [inline] hfsplus_delete_all_attrs+0x24a/0x330 fs/hfsplus/attributes.c:371 hfsplus_delete_cat+0x844/0xdd0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x213/0x7f0 fs/hfsplus/dir.c:385 vfs_unlink+0x2fb/0x9b0 fs/namei.c:4349 do_unlinkat+0x5c0/0x750 fs/namei.c:4413 __do_sys_unlink fs/namei.c:4461 [inline] __se_sys_unlink fs/namei.c:4459 [inline] __x64_sys_unlink+0xc7/0x110 fs/namei.c:4459 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88801aab0f00 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 [ffff88801aab0f00, ffff88801aab0f98) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1aab0 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000000 ffff8880154423c0 ffffea0000684180 dead000000000004 raw: 0000000000000000 0000000000100010 00000001ffffefff 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 3568994252, free_ts 3405011454 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x1353/0x2e50 mm/page_alloc.c:3425 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4683 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3990 [inline] kmalloc_trace_noprof+0x2b4/0x300 mm/slub.c:4149 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] call_usermodehelper_setup+0x9a/0x340 kernel/umh.c:363 kobject_uevent_env+0x14f1/0x1810 lib/kobject_uevent.c:613 acpi_device_add_finalize drivers/acpi/scan.c:1850 [inline] acpi_add_single_object+0xadf/0x1b50 drivers/acpi/scan.c:1908 acpi_bus_check_add+0x233/0xca0 drivers/acpi/scan.c:2152 acpi_ns_walk_namespace+0x405/0x5b0 drivers/acpi/acpica/nswalk.c:233 acpi_walk_namespace drivers/acpi/acpica/nsxfeval.c:606 [inline] acpi_walk_namespace+0x110/0x130 drivers/acpi/acpica/nsxfeval.c:554 acpi_bus_scan+0x3ea/0x4a0 drivers/acpi/scan.c:2564 acpi_scan_init+0x245/0x760 drivers/acpi/scan.c:2714 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2588 __put_partials+0x14c/0x170 mm/slub.c:2995 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_remove_cache+0x167/0x180 mm/kasan/quarantine.c:378 kmem_cache_shrink+0xd/0x20 mm/slab_common.c:518 acpi_os_purge_cache+0x15/0x20 drivers/acpi/osl.c:1573 acpi_purge_cached_objects+0x34/0x100 drivers/acpi/acpica/utxface.c:237 acpi_initialize_objects+0x47/0xa0 drivers/acpi/acpica/utxfinit.c:250 acpi_bus_init drivers/acpi/bus.c:1362 [inline] acpi_init+0x169/0xb80 drivers/acpi/bus.c:1447 do_one_initcall+0x128/0x700 init/main.c:1267 do_initcall_level init/main.c:1329 [inline] do_initcalls init/main.c:1345 [inline] do_basic_setup init/main.c:1364 [inline] kernel_init_freeable+0x69d/0xca0 init/main.c:1578 kernel_init+0x1c/0x2b0 init/main.c:1467 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88801aab0e80: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801aab0f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88801aab0f80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801aab1000: fa fb fb fb fb fb fb fb fb fc fc fc fc 00 00 00 ffff88801aab1080: 00 00 00 00 00 00 fc fc fc fc 00 00 00 00 00 00 ==================================================================