================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x22a/0x250 fs/hfsplus/bnode.c:37 Read of size 8 at addr ffff88804fc87a18 by task syz-executor.0/14487 CPU: 1 PID: 14487 Comm: syz-executor.0 Not tainted 6.8.0-rc2-syzkaller-00397-g56897d51886f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc4/0x620 mm/kasan/report.c:488 kasan_report+0xda/0x110 mm/kasan/report.c:601 hfsplus_bnode_read+0x22a/0x250 fs/hfsplus/bnode.c:37 hfsplus_bnode_read_key+0x14d/0x230 fs/hfsplus/bnode.c:70 hfsplus_brec_insert+0x8b3/0xc50 fs/hfsplus/brec.c:141 hfsplus_create_attr+0x3d0/0x4a0 fs/hfsplus/attributes.c:252 __hfsplus_setxattr+0x512/0x2290 fs/hfsplus/xattr.c:345 hfsplus_setxattr+0x98/0xe0 fs/hfsplus/xattr.c:434 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 do_setxattr+0x146/0x170 fs/xattr.c:630 setxattr+0x15d/0x180 fs/xattr.c:653 path_setxattr+0x179/0x1e0 fs/xattr.c:672 __do_sys_setxattr fs/xattr.c:688 [inline] __se_sys_setxattr fs/xattr.c:684 [inline] __ia32_sys_setxattr+0xc0/0x160 fs/xattr.c:684 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7c/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7c/0x86 RIP: 0023:0xf7314579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5f0e5ac EFLAGS: 00000292 ORIG_RAX: 00000000000000e2 RAX: ffffffffffffffda RBX: 0000000020000240 RCX: 0000000020000140 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 14487: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:372 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:389 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3981 [inline] __kmalloc+0x1f9/0x440 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] kzalloc include/linux/slab.h:711 [inline] __hfs_bnode_create+0x108/0x870 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x2c8/0xcb0 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x2b9/0x520 fs/hfsplus/bfind.c:183 hfsplus_find_attr+0xe6/0x250 fs/hfsplus/attributes.c:153 hfsplus_attr_exists+0x14d/0x200 fs/hfsplus/attributes.c:182 __hfsplus_setxattr+0x4be/0x2290 fs/hfsplus/xattr.c:336 hfsplus_setxattr+0x98/0xe0 fs/hfsplus/xattr.c:434 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 do_setxattr+0x146/0x170 fs/xattr.c:630 setxattr+0x15d/0x180 fs/xattr.c:653 path_setxattr+0x179/0x1e0 fs/xattr.c:672 __do_sys_setxattr fs/xattr.c:688 [inline] __se_sys_setxattr fs/xattr.c:684 [inline] __ia32_sys_setxattr+0xc0/0x160 fs/xattr.c:684 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7c/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7c/0x86 The buggy address belongs to the object at ffff88804fc87980 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes to the right of allocated 152-byte region [ffff88804fc87980, ffff88804fc87a18) The buggy address belongs to the physical page: page:ffffea00013f2180 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88804fc87760 pfn:0x4fc86 head:ffffea00013f2180 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000840(slab|head|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000000840 ffff888014c42a00 dead000000000100 dead000000000122 raw: ffff88804fc87760 00000000801e0018 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 11508, tgid 11508 (syz-executor.3), ts 290697562379, free_ts 288799472654 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311 __alloc_pages_slowpath mm/page_alloc.c:4101 [inline] __alloc_pages+0x692/0x2440 mm/page_alloc.c:4580 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4b0/0x1780 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] __do_kmalloc_node mm/slub.c:3980 [inline] __kmalloc+0x3b8/0x440 mm/slub.c:3994 kmalloc_array include/linux/slab.h:627 [inline] kcalloc include/linux/slab.h:658 [inline] ext4_find_extent+0x95c/0xce0 fs/ext4/extents.c:914 ext4_ext_map_blocks+0x26b/0x5ae0 fs/ext4/extents.c:4101 ext4_da_map_blocks fs/ext4/inode.c:1749 [inline] ext4_da_get_block_prep+0xd86/0x1340 fs/ext4/inode.c:1823 ext4_block_write_begin+0x3da/0xef0 fs/ext4/inode.c:1053 ext4_da_write_begin+0x40e/0x8c0 fs/ext4/inode.c:2900 generic_perform_write+0x273/0x620 mm/filemap.c:3930 ext4_buffered_write_iter+0x11f/0x3d0 fs/ext4/file.c:299 ext4_file_write_iter+0x819/0x1960 fs/ext4/file.c:698 __kernel_write_iter+0x33e/0xa70 fs/read_write.c:523 page last free pid 11458 tgid 11457 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2346 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486 vfree+0x181/0x7a0 mm/vmalloc.c:2842 kvfree+0x33/0x50 mm/util.c:661 btf_free+0x235/0x2e0 kernel/bpf/btf.c:1699 btf_parse kernel/bpf/btf.c:5580 [inline] btf_new_fd+0x730/0x2e70 kernel/bpf/btf.c:7243 bpf_btf_load kernel/bpf/syscall.c:4802 [inline] __sys_bpf+0x23e7/0x5830 kernel/bpf/syscall.c:5502 __do_sys_bpf kernel/bpf/syscall.c:5561 [inline] __se_sys_bpf kernel/bpf/syscall.c:5559 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5559 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7c/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7c/0x86 Memory state around the buggy address: ffff88804fc87900: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff88804fc87980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804fc87a00: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88804fc87a80: fc fc fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804fc87b00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi