================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x85/0x1c0 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff888073307be0 by task syz-executor.2/3613 CPU: 1 PID: 3613 Comm: syz-executor.2 Not tainted 5.15.155-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 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_attr+0x34f/0x4a0 fs/hfsplus/attributes.c:345 __hfsplus_setxattr+0x494/0x22c0 fs/hfsplus/xattr.c:342 hfsplus_setxattr+0xac/0xe0 fs/hfsplus/xattr.c:434 hfsplus_user_setxattr+0x3c/0x50 fs/hfsplus/xattr_user.c:30 __vfs_setxattr+0x3e7/0x420 fs/xattr.c:182 __vfs_setxattr_noperm+0x12a/0x5e0 fs/xattr.c:216 vfs_setxattr+0x21d/0x420 fs/xattr.c:303 do_setxattr fs/xattr.c:588 [inline] setxattr+0x27e/0x2e0 fs/xattr.c:611 path_setxattr+0x1bc/0x2a0 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+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f74a03abea9 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:00007f749e8dc0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc RAX: ffffffffffffffda RBX: 00007f74a04da120 RCX: 00007f74a03abea9 RDX: 0000000000000000 RSI: 0000000020000380 RDI: 0000000020000340 RBP: 00007f74a03f84a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f74a04da120 R15: 00007fffa63c5a08 Allocated by task 3607: 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_attr_exists+0x15b/0x1c0 fs/hfsplus/attributes.c:182 __hfsplus_setxattr+0x453/0x22c0 fs/hfsplus/xattr.c:336 hfsplus_setxattr+0xac/0xe0 fs/hfsplus/xattr.c:434 hfsplus_user_setxattr+0x3c/0x50 fs/hfsplus/xattr_user.c:30 __vfs_setxattr+0x3e7/0x420 fs/xattr.c:182 __vfs_setxattr_noperm+0x12a/0x5e0 fs/xattr.c:216 vfs_setxattr+0x21d/0x420 fs/xattr.c:303 do_setxattr fs/xattr.c:588 [inline] setxattr+0x27e/0x2e0 fs/xattr.c:611 path_setxattr+0x1bc/0x2a0 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+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888073307b00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 32 bytes to the right of 192-byte region [ffff888073307b00, ffff888073307bc0) The buggy address belongs to the page: page:ffffea0001ccc1c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73307 flags: 0xfff80000000200(slab|node=0|zone=1|lastcpupid=0xfff) raw: 00fff80000000200 0000000000000000 dead000000000122 ffff888011c41a00 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3528, ts 60534893277, free_ts 60492264408 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:5423 __alloc_pages_node include/linux/gfp.h:570 [inline] alloc_slab_page mm/slub.c:1777 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xb1/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] __kmalloc_node+0x1fa/0x390 mm/slub.c:4451 kmalloc_array_node include/linux/slab.h:684 [inline] kcalloc_node include/linux/slab.h:689 [inline] memcg_alloc_page_obj_cgroups+0x7e/0x120 mm/memcontrol.c:2836 memcg_slab_post_alloc_hook mm/slab.h:313 [inline] slab_post_alloc_hook+0xb6/0x380 mm/slab.h:526 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233 sock_alloc_inode+0x17/0xb0 net/socket.c:303 alloc_inode fs/inode.c:236 [inline] new_inode_pseudo+0x60/0x210 fs/inode.c:937 sock_alloc net/socket.c:626 [inline] __sock_create+0x11f/0x8d0 net/socket.c:1450 sock_create net/socket.c:1537 [inline] __sys_socket+0x132/0x370 net/socket.c:1579 __do_sys_socket net/socket.c:1588 [inline] __se_sys_socket net/socket.c:1586 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1586 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 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+0x95/0x2d0 mm/page_alloc.c:3396 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587 do_slab_free mm/slub.c:3487 [inline] ___cache_free+0xe3/0x100 mm/slub.c:3506 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] __kmalloc_node+0x151/0x390 mm/slub.c:4451 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x80/0x140 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] memcg_update_list_lru_node mm/list_lru.c:392 [inline] memcg_update_list_lru mm/list_lru.c:473 [inline] memcg_update_all_list_lrus+0x276/0xbf0 mm/list_lru.c:510 memcg_alloc_cache_id mm/memcontrol.c:2961 [inline] memcg_online_kmem mm/memcontrol.c:3653 [inline] mem_cgroup_css_alloc+0xa8e/0x1400 mm/memcontrol.c:5287 css_create kernel/cgroup/cgroup.c:5369 [inline] cgroup_apply_control_enable+0x398/0xae0 kernel/cgroup/cgroup.c:3189 cgroup_mkdir+0xdcd/0x1040 kernel/cgroup/cgroup.c:5587 kernfs_iop_mkdir+0x275/0x400 fs/kernfs/dir.c:1175 Memory state around the buggy address: ffff888073307a80: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff888073307b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888073307b80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888073307c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888073307c80: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================