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+0x22a/0x240 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff8880605954c0 by task syz-executor.4/14991 CPU: 1 PID: 14991 Comm: syz-executor.4 Not tainted 6.9.0-rc5-syzkaller-00042-ge88c4cfcb7b8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 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/0x910 fs/namei.c:4335 do_unlinkat+0x5c0/0x750 fs/namei.c:4399 __do_sys_unlink fs/namei.c:4447 [inline] __se_sys_unlink fs/namei.c:4445 [inline] __x64_sys_unlink+0xc7/0x110 fs/namei.c:4445 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd62607dea9 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:00007fd626d020c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 00007fd6261abf80 RCX: 00007fd62607dea9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000240 RBP: 00007fd6260ca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fd6261abf80 R15: 00007ffebbaf6058 Allocated by task 14991: 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:3966 [inline] __kmalloc+0x1f9/0x440 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [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/0x910 fs/namei.c:4335 do_unlinkat+0x5c0/0x750 fs/namei.c:4399 __do_sys_unlink fs/namei.c:4447 [inline] __se_sys_unlink fs/namei.c:4445 [inline] __x64_sys_unlink+0xc7/0x110 fs/namei.c:4445 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888060595400 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 [ffff888060595400, ffff888060595498) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x60595 flags: 0xfff80000000800(slab|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000800 ffff888015041a00 ffffea00008e0780 dead000000000002 raw: 0000000000000000 0000000000100010 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 0x112820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 959, tgid -788568596 (kworker/u8:5), ts 959, free_ts 218199566068 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmalloc_trace+0x2fb/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] addr_event.constprop.0+0xcc/0x560 drivers/infiniband/core/roce_gid_mgmt.c:840 inet6addr_event+0x117/0x180 drivers/infiniband/core/roce_gid_mgmt.c:883 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 atomic_notifier_call_chain+0x71/0x1c0 kernel/notifier.c:231 addrconf_ifdown.isra.0+0xf03/0x1b40 net/ipv6/addrconf.c:3979 addrconf_notify+0x223/0x19e0 net/ipv6/addrconf.c:3777 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] dev_close_many+0x333/0x6a0 net/core/dev.c:1543 page last free pid 2738 tgid 2738 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 __put_partials+0x14c/0x170 mm/slub.c:2906 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmalloc_trace+0x147/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] nsim_fib4_rt_create drivers/net/netdevsim/fib.c:280 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:426 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:464 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:884 [inline] nsim_fib_event_work+0x6b4/0x26e0 drivers/net/netdevsim/fib.c:1492 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 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: ffff888060595380: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff888060595400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888060595480: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888060595500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888060595580: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================