hfsplus: request for non-existent node 50331648 in B*Tree hfsplus: request for non-existent node 50331648 in B*Tree ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0xc9/0x200 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff888028b432c0 by task syz-executor.3/10031 CPU: 1 PID: 10031 Comm: syz-executor.3 Not tainted 6.1.0-rc6-syzkaller-00315-gfaf68e3523c2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x1f0 mm/kasan/report.c:395 kasan_report+0xcd/0x100 mm/kasan/report.c:495 hfsplus_bnode_read+0xc9/0x200 fs/hfsplus/bnode.c:32 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x29a/0x530 fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x430/0x4f0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x219/0x3d0 fs/hfsplus/attributes.c:299 hfsplus_delete_all_attrs+0x292/0x430 fs/hfsplus/attributes.c:378 hfsplus_delete_cat+0xa64/0xe90 fs/hfsplus/catalog.c:425 hfsplus_unlink+0x342/0x7d0 fs/hfsplus/dir.c:385 vfs_unlink+0x357/0x5f0 fs/namei.c:4252 do_unlinkat+0x484/0x940 fs/namei.c:4320 __do_sys_unlink fs/namei.c:4368 [inline] __se_sys_unlink fs/namei.c:4366 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4366 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+0x63/0xcd RIP: 0033:0x7f73dbc8c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f73dc91b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 00007f73dbdac050 RCX: 00007f73dbc8c0d9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007f73dbce7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe22d98caf R14: 00007f73dc91b300 R15: 0000000000022000 Allocated by task 10028: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0xaf/0x1a0 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [inline] kzalloc include/linux/slab.h:689 [inline] __hfs_bnode_create+0xec/0x7f0 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x23d/0xd80 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x145/0x520 fs/hfsplus/bfind.c:183 __hfsplus_getxattr+0x325/0x9f0 fs/hfsplus/xattr.c:522 hfsplus_getxattr+0xd3/0x120 fs/hfsplus/xattr.c:590 vfs_getxattr_alloc+0x47f/0x5d0 fs/xattr.c:380 ima_read_xattr+0x35/0x60 security/integrity/ima/ima_appraise.c:228 process_measurement+0xd5d/0x1bd0 security/integrity/ima/ima_main.c:319 ima_file_check+0xd8/0x130 security/integrity/ima/ima_main.c:517 do_open fs/namei.c:3559 [inline] path_openat+0x2642/0x2df0 fs/namei.c:3714 do_filp_open+0x264/0x4f0 fs/namei.c:3741 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_openat fs/open.c:1342 [inline] __se_sys_openat fs/open.c:1337 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1337 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+0x63/0xcd The buggy address belongs to the object at ffff888028b43200 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes to the right of 192-byte region [ffff888028b43200, ffff888028b432c0) The buggy address belongs to the physical page: page:ffffea0000a2d0c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28b43 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888012841a00 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 9485, tgid 9481 (syz-executor.4), ts 596346608815, free_ts 590951959783 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4291 __alloc_pages+0x259/0x560 mm/page_alloc.c:5558 __alloc_pages_node include/linux/gfp.h:223 [inline] alloc_slab_page+0x2e/0xf0 mm/slub.c:1796 allocate_slab+0x5e/0x4b0 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0x782/0xe20 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x252/0x310 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node+0x9e/0x190 mm/slab_common.c:962 kmalloc_array_node include/linux/slab.h:666 [inline] kcalloc_node include/linux/slab.h:671 [inline] memcg_alloc_slab_cgroups+0x7c/0x120 mm/memcontrol.c:2885 memcg_slab_post_alloc_hook+0x62/0x330 mm/slab.h:528 slab_post_alloc_hook mm/slab.h:745 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x206/0x300 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:679 [inline] alloc_buffer_head+0x20/0xf0 fs/buffer.c:2899 alloc_page_buffers+0x179/0x460 fs/buffer.c:829 grow_dev_page+0x244/0x920 fs/buffer.c:965 grow_buffers fs/buffer.c:1011 [inline] __getblk_slow fs/buffer.c:1038 [inline] __getblk_gfp+0x16c/0x290 fs/buffer.c:1333 sb_getblk_gfp include/linux/buffer_head.h:363 [inline] ext4_ext_grow_indepth fs/ext4/extents.c:1334 [inline] ext4_ext_create_new_leaf fs/ext4/extents.c:1435 [inline] ext4_ext_insert_extent+0xe8b/0x4e40 fs/ext4/extents.c:2102 ext4_split_extent_at+0x84b/0x1400 fs/ext4/extents.c:3254 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x80c/0x8f0 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page_list+0xb4/0x7b0 mm/page_alloc.c:3529 release_pages+0x232a/0x25c0 mm/swap.c:1055 __pagevec_release+0x7d/0xf0 mm/swap.c:1075 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] truncate_inode_pages_range+0x472/0x17f0 mm/truncate.c:373 kill_bdev block/bdev.c:76 [inline] blkdev_flush_mapping+0x153/0x2c0 block/bdev.c:662 blkdev_put_whole block/bdev.c:693 [inline] blkdev_put+0x4a5/0x730 block/bdev.c:953 kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4612 deactivate_locked_super+0xa7/0xf0 fs/super.c:332 cleanup_mnt+0x494/0x520 fs/namespace.c:1186 task_work_run+0x243/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x124/0x150 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb2/0x140 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:296 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888028b43180: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888028b43200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888028b43280: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888028b43300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888028b43380: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================