hfsplus: request for non-existent node 393216 in B*Tree hfsplus: request for non-existent node 393216 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x144/0x150 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff88802206d3c0 by task syz-executor386/4994 CPU: 0 PID: 4994 Comm: syz-executor386 Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 hfsplus_bnode_read+0x144/0x150 fs/hfsplus/bnode.c:32 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x2c6/0x3a0 fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x3db/0x4f0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x28a/0x3a0 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x25d/0x320 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0x86a/0xe40 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x1e3/0x830 fs/hfsplus/dir.c:385 vfs_unlink+0x355/0x930 fs/namei.c:4327 do_unlinkat+0x3e3/0x680 fs/namei.c:4393 __do_sys_unlink fs/namei.c:4441 [inline] __se_sys_unlink fs/namei.c:4439 [inline] __x64_sys_unlink+0xca/0x110 fs/namei.c:4439 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe88ec96829 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe775eb748 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe88ec96829 RDX: 00007fe88ec54ea3 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007fe88ec560c0 R08: 00000000000005f2 R09: 0000000000000000 R10: 00007ffe775eb610 R11: 0000000000000246 R12: 00007fe88ec56150 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 4994: kasan_save_stack+0x22/0x40 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 mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0x5e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:680 [inline] __hfs_bnode_create+0x107/0x840 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x41c/0xc60 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x2b3/0x520 fs/hfsplus/bfind.c:183 hfsplus_find_attr fs/hfsplus/attributes.c:160 [inline] hfsplus_delete_all_attrs+0x236/0x320 fs/hfsplus/attributes.c:371 hfsplus_delete_cat+0x86a/0xe40 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x1e3/0x830 fs/hfsplus/dir.c:385 vfs_unlink+0x355/0x930 fs/namei.c:4327 do_unlinkat+0x3e3/0x680 fs/namei.c:4393 __do_sys_unlink fs/namei.c:4441 [inline] __se_sys_unlink fs/namei.c:4439 [inline] __x64_sys_unlink+0xca/0x110 fs/namei.c:4439 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491 insert_work+0x48/0x360 kernel/workqueue.c:1365 __queue_work+0x625/0x1120 kernel/workqueue.c:1526 queue_work_on+0xf2/0x110 kernel/workqueue.c:1554 queue_work include/linux/workqueue.h:505 [inline] call_usermodehelper_exec+0x1d2/0x4c0 kernel/umh.c:434 kobject_uevent_env+0xefc/0x16c0 lib/kobject_uevent.c:618 driver_register+0x2df/0x4a0 drivers/base/driver.c:254 __mhi_driver_register+0x10d/0x160 drivers/bus/mhi/host/init.c:1400 do_one_initcall+0x102/0x540 init/main.c:1246 do_initcall_level init/main.c:1319 [inline] do_initcalls init/main.c:1335 [inline] do_basic_setup init/main.c:1354 [inline] kernel_init_freeable+0x64e/0xba0 init/main.c:1571 kernel_init+0x1e/0x2c0 init/main.c:1462 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88802206d300 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 [ffff88802206d300, ffff88802206d398) The buggy address belongs to the physical page: page:ffffea0000881b40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2206d flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x10() raw: 00fff00000000200 ffff888012440000 ffffea000087dfd0 ffff888012441150 raw: 0000000000000000 ffff88802206d000 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 13296283732, free_ts 13294766286 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1360 [inline] cache_grow_begin+0x9b/0x3b0 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] __do_cache_alloc mm/slab.c:3201 [inline] slab_alloc_node mm/slab.c:3249 [inline] __kmem_cache_alloc_node+0x360/0x3f0 mm/slab.c:3540 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node_track_caller+0x4f/0x1a0 mm/slab_common.c:986 kmemdup+0x2c/0x60 mm/util.c:131 kmemdup include/linux/fortify-string.h:702 [inline] neigh_parms_alloc+0x82/0x5f0 net/core/neighbour.c:1705 inetdev_init+0x133/0x580 net/ipv4/devinet.c:276 inetdev_event+0xe7c/0x1720 net/ipv4/devinet.c:1538 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] register_netdevice+0xfb4/0x1640 net/core/dev.c:10120 init_mac80211_hwsim+0x762/0x830 drivers/net/wireless/virtual/mac80211_hwsim.c:6665 do_one_initcall+0x102/0x540 init/main.c:1246 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2564 free_unref_page+0x33/0x370 mm/page_alloc.c:2659 vfree+0x180/0x7e0 mm/vmalloc.c:2798 delayed_vfree_work+0x57/0x70 mm/vmalloc.c:2719 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff88802206d280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802206d300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802206d380: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802206d400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802206d480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================