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+0x234/0x250 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff88801cf4e7c0 by task syz-executor534/5062 CPU: 1 PID: 5062 Comm: syz-executor534 Not tainted 6.7.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 hfsplus_bnode_read+0x234/0x250 fs/hfsplus/bnode.c:32 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x2a2/0x3d0 fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x3de/0x4f0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x29e/0x3b0 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x26d/0x330 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x83b/0xdd0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x213/0x7f0 fs/hfsplus/dir.c:385 vfs_unlink+0x2f1/0x900 fs/namei.c:4318 do_unlinkat+0x5bc/0x740 fs/namei.c:4382 __do_sys_unlink fs/namei.c:4430 [inline] __se_sys_unlink fs/namei.c:4428 [inline] __x64_sys_unlink+0xc8/0x110 fs/namei.c:4428 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fe883cfe5f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fffa3abefb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 00007fffa3abf198 RCX: 00007fe883cfe5f9 RDX: 00007fe883cfd8f0 RSI: 0000000000000000 RDI: 0000000020000140 RBP: 00007fe883d71610 R08: 0000000000000640 R09: 0000000000000000 R10: 00007fffa3abee80 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fffa3abf188 R14: 0000000000000001 R15: 0000000000000001 Allocated by task 5062: kasan_save_stack+0x33/0x50 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+0xa3/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc+0x59/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:721 [inline] __hfs_bnode_create+0x108/0x860 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x2c4/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+0x246/0x330 fs/hfsplus/attributes.c:371 hfsplus_delete_cat+0x83b/0xdd0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x213/0x7f0 fs/hfsplus/dir.c:385 vfs_unlink+0x2f1/0x900 fs/namei.c:4318 do_unlinkat+0x5bc/0x740 fs/namei.c:4382 __do_sys_unlink fs/namei.c:4430 [inline] __se_sys_unlink fs/namei.c:4428 [inline] __x64_sys_unlink+0xc8/0x110 fs/namei.c:4428 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 insert_work+0x38/0x230 kernel/workqueue.c:1647 __queue_work+0x62e/0x11d0 kernel/workqueue.c:1796 queue_work_on+0xed/0x110 kernel/workqueue.c:1831 queue_work include/linux/workqueue.h:562 [inline] call_usermodehelper_exec+0x1d2/0x4c0 kernel/umh.c:434 kobject_uevent_env+0x1693/0x1800 lib/kobject_uevent.c:618 tty_register_device_attr+0x4bc/0x7b0 drivers/tty/tty_io.c:3273 tty_register_device drivers/tty/tty_io.c:3187 [inline] tty_register_driver+0x431/0x7f0 drivers/tty/tty_io.c:3450 legacy_pty_init drivers/tty/pty.c:581 [inline] pty_init+0x69c/0x1110 drivers/tty/pty.c:943 do_one_initcall+0x11c/0x650 init/main.c:1236 do_initcall_level init/main.c:1298 [inline] do_initcalls init/main.c:1314 [inline] do_basic_setup init/main.c:1333 [inline] kernel_init_freeable+0x687/0xc10 init/main.c:1551 kernel_init+0x1c/0x2a0 init/main.c:1441 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 The buggy address belongs to the object at ffff88801cf4e700 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 [ffff88801cf4e700, ffff88801cf4e798) The buggy address belongs to the physical page: page:ffffea000073d380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1cf4e flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x10() raw: 00fff00000000800 ffff888013040000 ffffea0000786b10 ffffea0000746090 raw: 0000000000000000 ffff88801cf4e000 0000000100000010 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 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 1, tgid 1 (swapper/0), ts 8397747602, free_ts 8396252502 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568 __alloc_pages_node include/linux/gfp.h:238 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x295/0x3b0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] __kmem_cache_alloc_node+0x3ba/0x460 mm/slab.c:3521 kmalloc_trace+0x25/0x60 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] call_usermodehelper_setup+0x9a/0x340 kernel/umh.c:363 kobject_uevent_env+0x1678/0x1800 lib/kobject_uevent.c:614 tty_register_device_attr+0x4bc/0x7b0 drivers/tty/tty_io.c:3273 tty_register_device drivers/tty/tty_io.c:3187 [inline] tty_register_driver+0x431/0x7f0 drivers/tty/tty_io.c:3450 legacy_pty_init drivers/tty/pty.c:581 [inline] pty_init+0x69c/0x1110 drivers/tty/pty.c:943 do_one_initcall+0x11c/0x650 init/main.c:1236 do_initcall_level init/main.c:1298 [inline] do_initcalls init/main.c:1314 [inline] do_basic_setup init/main.c:1333 [inline] kernel_init_freeable+0x687/0xc10 init/main.c:1551 kernel_init+0x1c/0x2a0 init/main.c:1441 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4fa/0xaa0 mm/page_alloc.c:2347 free_unref_page_list+0xe6/0xb40 mm/page_alloc.c:2533 release_pages+0x32a/0x14f0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98 tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu mm/mmu_gather.c:300 [inline] tlb_finish_mmu+0x14b/0x6f0 mm/mmu_gather.c:392 exit_mmap+0x38b/0xa70 mm/mmap.c:3321 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 free_bprm+0x144/0x3f0 fs/exec.c:1490 kernel_execve+0x3e7/0x4e0 fs/exec.c:2024 call_usermodehelper_exec_async+0x256/0x4c0 kernel/umh.c:110 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Memory state around the buggy address: ffff88801cf4e680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801cf4e700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88801cf4e780: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801cf4e800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801cf4e880: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================