hfsplus: request for non-existent node -16711680 in B*Tree hfsplus: request for non-existent node -16711680 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x8f/0x1e0 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff88814966a8c0 by task syz.4.943/10283 CPU: 1 PID: 10283 Comm: syz.4.943 Not tainted 5.15.181-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 hfsplus_bnode_read+0x8f/0x1e0 fs/hfsplus/bnode.c:32 hfsplus_bnode_dump+0x4b3/0x620 fs/hfsplus/bnode.c:-1 hfsplus_brec_remove+0x476/0x540 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x1d1/0x360 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x240/0x3a0 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x94a/0xd20 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x33c/0x760 fs/hfsplus/dir.c:385 vfs_unlink+0x385/0x600 fs/namei.c:4280 do_unlinkat+0x382/0x6f0 fs/namei.c:4348 __do_sys_unlinkat fs/namei.c:4391 [inline] __se_sys_unlinkat fs/namei.c:4384 [inline] __x64_sys_unlinkat+0xd1/0xe0 fs/namei.c:4384 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f9d9844f969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9d96296038 EFLAGS: 00000246 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 00007f9d98677080 RCX: 00007f9d9844f969 RDX: 0000000000000000 RSI: 0000200000000c40 RDI: ffffffffffffff9c RBP: 00007f9d984d1ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9d98677080 R15: 00007ffff204bae8 Allocated by task 10268: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:609 [inline] kzalloc include/linux/slab.h:735 [inline] __hfs_bnode_create+0xf1/0xc10 fs/hfsplus/bnode.c:422 hfsplus_bnode_find+0x220/0xd00 fs/hfsplus/bnode.c:503 hfsplus_brec_find+0x159/0x500 fs/hfsplus/bfind.c:172 hfsplus_attr_exists+0x160/0x1d0 fs/hfsplus/attributes.c:182 __hfsplus_setxattr+0x475/0x1e20 fs/hfsplus/xattr.c:336 hfsplus_setxattr+0xac/0xe0 fs/hfsplus/xattr.c:434 hfsplus_trusted_setxattr+0x3c/0x50 fs/hfsplus/xattr_trusted.c:30 __vfs_setxattr+0x3e0/0x420 fs/xattr.c:182 __vfs_setxattr_noperm+0x129/0x5e0 fs/xattr.c:216 vfs_setxattr+0x168/0x2f0 fs/xattr.c:303 do_setxattr fs/xattr.c:588 [inline] setxattr+0x2da/0x300 fs/xattr.c:611 path_setxattr+0x142/0x280 fs/xattr.c:630 __do_sys_setxattr fs/xattr.c:646 [inline] __se_sys_setxattr fs/xattr.c:642 [inline] __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:642 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x35/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348 insert_work+0x54/0x3d0 kernel/workqueue.c:1366 __queue_work+0x9c5/0xd50 kernel/workqueue.c:1532 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559 inet6addr_event+0x9c/0xc0 drivers/infiniband/core/roce_gid_mgmt.c:883 notifier_call_chain kernel/notifier.c:83 [inline] atomic_notifier_call_chain+0x15d/0x280 kernel/notifier.c:198 ipv6_add_addr+0xb30/0xde0 net/ipv6/addrconf.c:1182 inet6_addr_add+0x43a/0x9c0 net/ipv6/addrconf.c:2999 inet6_rtm_newaddr+0x5d7/0x840 net/ipv6/addrconf.c:4954 rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2489 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x77c/0x920 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x8ab/0xbc0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x423/0x580 net/socket.c:2063 __do_sys_sendto net/socket.c:2075 [inline] __se_sys_sendto net/socket.c:2071 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2071 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Second to last potentially related work creation: kasan_save_stack+0x35/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348 insert_work+0x54/0x3d0 kernel/workqueue.c:1366 __queue_work+0x9c5/0xd50 kernel/workqueue.c:1532 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559 queue_work include/linux/workqueue.h:512 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:659 [inline] netdevice_event+0x803/0x900 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline] call_netdevice_notifiers net/core/dev.c:2075 [inline] unregister_netdevice_many+0xf57/0x18f0 net/core/dev.c:11134 default_device_exit_batch+0x336/0x390 net/core/dev.c:11667 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x77b/0xb80 net/core/net_namespace.c:635 process_one_work+0x863/0x1000 kernel/workqueue.c:2310 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff88814966a800 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes to the right of 192-byte region [ffff88814966a800, ffff88814966a8c0) The buggy address belongs to the page: page:ffffea0005259a80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14966a flags: 0x57ff00000000200(slab|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000000200 ffffea00050eee80 0000000300000003 ffff888016841a00 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 9617669462, free_ts 0 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5466 alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2031 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1975 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc_trace+0x1a5/0x2a0 mm/slub.c:3245 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:735 [inline] call_usermodehelper_setup+0x8a/0x260 kernel/umh.c:365 kobject_uevent_env+0x65e/0x890 lib/kobject_uevent.c:629 device_add+0x91c/0xfb0 drivers/base/core.c:3393 __video_register_device+0x3843/0x4670 drivers/media/v4l2-core/v4l2-dev.c:1037 video_register_device include/media/v4l2-dev.h:384 [inline] vivid_create_devnodes+0x2266/0x2cd0 drivers/media/test-drivers/vivid/vivid-core.c:1692 vivid_create_instance drivers/media/test-drivers/vivid/vivid-core.c:1976 [inline] vivid_probe+0x50a1/0x6950 drivers/media/test-drivers/vivid/vivid-core.c:2031 platform_probe+0x137/0x1c0 drivers/base/platform.c:1391 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x284/0xc80 drivers/base/dd.c:595 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755 driver_probe_device+0x4f/0x420 drivers/base/dd.c:785 page_owner free stack trace missing Memory state around the buggy address: ffff88814966a780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88814966a800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88814966a880: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88814966a900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88814966a980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================