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+0x85/0x1c0 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff8880202e2cc8 by task syz.9.1154/11012 CPU: 0 PID: 11012 Comm: syz.9.1154 Not tainted 5.15.180-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 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 vfs_unlink+0x359/0x5f0 fs/namei.c:4280 do_unlinkat+0x4a3/0x950 fs/namei.c:4348 __do_sys_unlinkat fs/namei.c:4391 [inline] __se_sys_unlinkat fs/namei.c:4384 [inline] __x64_sys_unlinkat+0xca/0xf0 fs/namei.c:4384 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fc42bc59169 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:00007fc429ac1038 EFLAGS: 00000246 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 00007fc42be80fa0 RCX: 00007fc42bc59169 RDX: 0000000000000000 RSI: 0000200000000c40 RDI: ffffffffffffff9c RBP: 00007fc42bcdba68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fc42be80fa0 R15: 00007fffbd2d8ef8 Allocated by task 11012: 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:609 [inline] kzalloc include/linux/slab.h:735 [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:172 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 vfs_unlink+0x359/0x5f0 fs/namei.c:4280 do_unlinkat+0x4a3/0x950 fs/namei.c:4348 __do_sys_unlinkat fs/namei.c:4391 [inline] __se_sys_unlinkat fs/namei.c:4384 [inline] __x64_sys_unlinkat+0xca/0xf0 fs/namei.c:4384 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 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] loop_queue_work drivers/block/loop.c:1067 [inline] loop_queue_rq+0x9ed/0xae0 drivers/block/loop.c:2201 __blk_mq_issue_directly block/blk-mq.c:2014 [inline] __blk_mq_try_issue_directly+0x4be/0x860 block/blk-mq.c:2070 blk_mq_try_issue_directly+0x116/0x370 block/blk-mq.c:2101 blk_mq_submit_bio+0x11bb/0x1c40 block/blk-mq.c:2323 __submit_bio+0x813/0x850 block/blk-core.c:917 __submit_bio_noacct_mq block/blk-core.c:997 [inline] submit_bio_noacct+0x955/0xb30 block/blk-core.c:1027 submit_bio+0x2dd/0x560 block/blk-core.c:1089 submit_bh fs/buffer.c:3062 [inline] __sync_dirty_buffer+0x245/0x380 fs/buffer.c:3157 fat_set_state+0x278/0x360 fs/fat/inode.c:709 fat_put_super+0x44/0xb0 fs/fat/inode.c:735 generic_shutdown_super+0x130/0x310 fs/super.c:475 kill_block_super+0x7a/0xe0 fs/super.c:1427 deactivate_locked_super+0xa0/0x110 fs/super.c:335 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0x80 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 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] loop_queue_work drivers/block/loop.c:1067 [inline] loop_queue_rq+0x9ed/0xae0 drivers/block/loop.c:2201 __blk_mq_issue_directly block/blk-mq.c:2014 [inline] __blk_mq_try_issue_directly+0x4be/0x860 block/blk-mq.c:2070 blk_mq_request_issue_directly block/blk-mq.c:2118 [inline] blk_mq_try_issue_list_directly+0x245/0x650 block/blk-mq.c:2136 blk_mq_sched_insert_requests+0x284/0x570 block/blk-mq-sched.c:512 blk_mq_flush_plug_list+0x5de/0x6b0 block/blk-mq.c:1971 blk_flush_plug_list+0x44b/0x490 block/blk-core.c:1734 blk_finish_plug+0x59/0x80 block/blk-core.c:1751 generic_writepages+0x105/0x160 mm/page-writeback.c:2369 do_writepages+0x481/0x730 mm/page-writeback.c:2386 filemap_fdatawrite_wbc+0x1d6/0x230 mm/filemap.c:400 __filemap_fdatawrite_range mm/filemap.c:433 [inline] __filemap_fdatawrite mm/filemap.c:439 [inline] filemap_flush+0x10c/0x150 mm/filemap.c:466 sync_filesystem+0x142/0x220 fs/sync.c:60 generic_shutdown_super+0x6b/0x310 fs/super.c:448 kill_block_super+0x7a/0xe0 fs/super.c:1427 deactivate_locked_super+0xa0/0x110 fs/super.c:335 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0x80 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff8880202e2c00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 8 bytes to the right of 192-byte region [ffff8880202e2c00, ffff8880202e2cc0) The buggy address belongs to the page: page:ffffea000080b880 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x202e2 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000070e3c0 0000000400000004 ffff888017441a00 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 150, ts 7481270509, free_ts 7480171909 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5466 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:604 [inline] blk_stat_alloc_callback+0x5c/0x230 block/blk-stat.c:109 blk_mq_init_allocated_queue+0x86/0x17a0 block/blk-mq.c:3304 blk_mq_init_queue_data block/blk-mq.c:3154 [inline] blk_mq_init_queue+0x64/0xc0 block/blk-mq.c:3164 scsi_alloc_sdev+0x74b/0xb40 drivers/scsi/scsi_scan.c:319 scsi_probe_and_add_lun+0x1cf/0x4c30 drivers/scsi/scsi_scan.c:1157 __scsi_scan_target+0x1fc/0x10b0 drivers/scsi/scsi_scan.c:1638 scsi_scan_channel drivers/scsi/scsi_scan.c:1726 [inline] scsi_scan_host_selected+0x37a/0x690 drivers/scsi/scsi_scan.c:1755 do_scsi_scan_host drivers/scsi/scsi_scan.c:1894 [inline] do_scan_async+0x12e/0x780 drivers/scsi/scsi_scan.c:1904 async_run_entry_fn+0xa2/0x410 kernel/async.c:127 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page_list+0x1f7/0x8e0 mm/page_alloc.c:3433 release_pages+0x1bb9/0x1f40 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338 exit_mmap+0x3cd/0x620 mm/mmap.c:3206 __mmput+0x112/0x3b0 kernel/fork.c:1127 free_bprm+0x135/0x2f0 fs/exec.c:1494 kernel_execve+0x3bd/0x9b0 fs/exec.c:2015 call_usermodehelper_exec_async+0x22f/0x370 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff8880202e2b80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880202e2c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880202e2c80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880202e2d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880202e2d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================