================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0x1e4/0x240 fs/hfsplus/bnode.c:37 Read of size 8 at addr ffff88801dbaca98 by task syz-executor.2/5460 CPU: 0 PID: 5460 Comm: syz-executor.2 Not tainted 6.8.0-syzkaller-13213-g70293240c5ce #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+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 hfsplus_bnode_read+0x1e4/0x240 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+0x3cf/0x4a0 fs/hfsplus/attributes.c:252 __hfsplus_setxattr+0x519/0x2180 fs/hfsplus/xattr.c:345 hfsplus_setxattr+0x10c/0x180 fs/hfsplus/xattr.c:434 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x350 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 setxattr+0x15d/0x180 fs/xattr.c:652 path_setxattr+0x179/0x1e0 fs/xattr.c:671 __do_sys_setxattr fs/xattr.c:687 [inline] __se_sys_setxattr fs/xattr.c:683 [inline] __x64_sys_setxattr+0xc4/0x160 fs/xattr.c:683 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f0ba687dda9 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:00007f0ba76720c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc RAX: ffffffffffffffda RBX: 00007f0ba69abf80 RCX: 00007f0ba687dda9 RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000020000280 RBP: 00007f0ba68ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f0ba69abf80 R15: 00007ffeeb37d348 Allocated by task 5460: 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:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3966 [inline] __kmalloc+0x1f9/0x440 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [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_delete_attr+0x23e/0x310 fs/hfsplus/attributes.c:341 hfsplus_removexattr fs/hfsplus/xattr.c:794 [inline] __hfsplus_setxattr+0x8a6/0x2180 fs/hfsplus/xattr.c:275 hfsplus_setxattr+0x10c/0x180 fs/hfsplus/xattr.c:434 __vfs_removexattr+0x153/0x1c0 fs/xattr.c:518 __vfs_removexattr_locked+0x166/0x440 fs/xattr.c:553 vfs_removexattr+0xcf/0x260 fs/xattr.c:575 removexattr+0x137/0x1b0 fs/xattr.c:917 path_removexattr+0x161/0x1c0 fs/xattr.c:931 __do_sys_removexattr fs/xattr.c:945 [inline] __se_sys_removexattr fs/xattr.c:942 [inline] __x64_sys_removexattr+0x59/0x80 fs/xattr.c:942 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff88801dbaca00 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 [ffff88801dbaca00, ffff88801dbaca98) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1dbac flags: 0xfff80000000800(slab|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000800 ffff888015442a00 dead000000000100 dead000000000122 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 6209698754, free_ts 6185469458 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmalloc_trace+0x2fb/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] call_usermodehelper_setup+0x9a/0x340 kernel/umh.c:363 kobject_uevent_env+0x14f4/0x1820 lib/kobject_uevent.c:613 tty_register_device_attr+0x4bc/0x7c0 drivers/tty/tty_io.c:3296 tty_register_device drivers/tty/tty_io.c:3210 [inline] tty_register_driver+0x431/0x800 drivers/tty/tty_io.c:3473 legacy_pty_init drivers/tty/pty.c:579 [inline] pty_init+0x67c/0x1110 drivers/tty/pty.c:943 do_one_initcall+0x128/0x700 init/main.c:1238 do_initcall_level init/main.c:1300 [inline] do_initcalls init/main.c:1316 [inline] do_basic_setup init/main.c:1335 [inline] kernel_init_freeable+0x69d/0xca0 init/main.c:1548 kernel_init+0x1c/0x2b0 init/main.c:1437 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 page last free pid 9 tgid 9 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 vfree+0x181/0x7a0 mm/vmalloc.c:3324 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:3245 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Memory state around the buggy address: ffff88801dbac980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801dbaca00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88801dbaca80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801dbacb00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801dbacb80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================