hfsplus: request for non-existent node 768 in B*Tree hfsplus: request for non-existent node 768 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x85/0x1c0 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff88801851d5c0 by task syz-executor.2/19667 CPU: 1 PID: 19667 Comm: syz-executor.2 Not tainted 5.15.152-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 hfsplus_bnode_read+0x85/0x1c0 fs/hfsplus/bnode.c:32 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:47 [inline] hfsplus_bnode_dump+0x3f7/0x7c0 fs/hfsplus/bnode.c:328 hfsplus_brec_remove+0x428/0x4e0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x271/0x450 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x267/0x3c0 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0xb83/0xfb0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x35f/0x7f0 fs/hfsplus/dir.c:385 hfsplus_rename+0xc4/0x1b0 fs/hfsplus/dir.c:547 vfs_rename+0xd32/0x10f0 fs/namei.c:4832 do_renameat2+0xe0f/0x1700 fs/namei.c:4985 __do_sys_rename fs/namei.c:5031 [inline] __se_sys_rename fs/namei.c:5029 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5029 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fdbfa8d9da9 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:00007fdbf8e5a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007fdbfaa07f80 RCX: 00007fdbfa8d9da9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000020000080 RBP: 00007fdbfa92647a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fdbfaa07f80 R15: 00007ffdb076b068 Allocated by task 19667: 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+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] __hfs_bnode_create+0xf9/0xbb0 fs/hfsplus/bnode.c:416 hfsplus_bnode_find+0x22e/0xe80 fs/hfsplus/bnode.c:497 hfsplus_brec_find+0x17f/0x570 fs/hfsplus/bfind.c:183 hfsplus_find_attr fs/hfsplus/attributes.c:160 [inline] hfsplus_delete_all_attrs+0x23e/0x3c0 fs/hfsplus/attributes.c:371 hfsplus_delete_cat+0xb83/0xfb0 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x35f/0x7f0 fs/hfsplus/dir.c:385 hfsplus_rename+0xc4/0x1b0 fs/hfsplus/dir.c:547 vfs_rename+0xd32/0x10f0 fs/namei.c:4832 do_renameat2+0xe0f/0x1700 fs/namei.c:4985 __do_sys_rename fs/namei.c:5031 [inline] __se_sys_rename fs/namei.c:5029 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5029 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3087 addrconf_ifdown+0x18eb/0x1bb0 net/ipv6/addrconf.c:3930 addrconf_notify+0x432/0xf30 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2018 [inline] call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers net/core/dev.c:2044 [inline] unregister_netdevice_many+0xf1b/0x18f0 net/core/dev.c:11090 default_device_exit_batch+0x390/0x3f0 net/core/dev.c:11623 ops_exit_list net/core/net_namespace.c:174 [inline] cleanup_net+0x763/0xb60 net/core/net_namespace.c:596 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Second to last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1366 __queue_work+0x963/0xd00 kernel/workqueue.c:1532 queue_work_on+0x14b/0x250 kernel/workqueue.c:1559 queue_work include/linux/workqueue.h:512 [inline] call_usermodehelper_exec+0x269/0x450 kernel/umh.c:435 call_modprobe kernel/kmod.c:98 [inline] __request_module+0x41c/0x9b0 kernel/kmod.c:170 get_fs_type+0x177/0x470 fs/filesystems.c:280 tomoyo_mount_acl security/tomoyo/mount.c:125 [inline] tomoyo_mount_permission+0x465/0xb20 security/tomoyo/mount.c:237 security_sb_mount+0x88/0xc0 security/security.c:978 path_mount+0xbd/0x10a0 fs/namespace.c:3277 do_mount fs/namespace.c:3348 [inline] __do_sys_mount fs/namespace.c:3556 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88801851d500 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes to the right of 192-byte region [ffff88801851d500, ffff88801851d5c0) The buggy address belongs to the page: page:ffffea0000614740 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1851d flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888011c41a00 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, ts 3362219896, free_ts 0 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421 alloc_page_interleave+0x22/0x1c0 mm/mempolicy.c:2031 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 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+0x1a0/0x290 mm/slub.c:3245 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] call_usermodehelper_setup+0x8a/0x260 kernel/umh.c:365 kobject_uevent_env+0x681/0x8d0 lib/kobject_uevent.c:614 tty_register_device_attr+0x582/0x960 drivers/tty/tty_io.c:3311 tty_register_device drivers/tty/tty_io.c:3224 [inline] tty_register_driver+0x5f6/0xc50 drivers/tty/tty_io.c:3482 vty_init+0x218/0x313 drivers/tty/vt/vt.c:3616 tty_init+0x134/0x172 drivers/tty/tty_io.c:3634 do_one_initcall+0x22b/0x7a0 init/main.c:1299 do_initcall_level+0x157/0x207 init/main.c:1372 do_initcalls+0x49/0x86 init/main.c:1388 kernel_init_freeable+0x425/0x5b5 init/main.c:1612 page_owner free stack trace missing Memory state around the buggy address: ffff88801851d480: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801851d500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88801851d580: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801851d600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801851d680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================