================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_bnode_read+0xc1/0x1e0 fs/hfsplus/bnode.c:32 Read of size 8 at addr ffff888033d5b9c8 by task syz.0.0/5327 CPU: 0 UID: 0 PID: 5327 Comm: syz.0.0 Not tainted 6.14.0-rc6-syzkaller-00016-g0fed89a961ea #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 hfsplus_bnode_read+0xc1/0x1e0 fs/hfsplus/bnode.c:32 hfsplus_bnode_read_u16 fs/hfsplus/bnode.c:45 [inline] hfsplus_bnode_dump+0x289/0x6a0 fs/hfsplus/bnode.c:321 hfsplus_brec_remove+0x42c/0x4f0 fs/hfsplus/brec.c:229 __hfsplus_delete_attr+0x275/0x450 fs/hfsplus/attributes.c:299 hfsplus_delete_attr+0x25b/0x2f0 fs/hfsplus/attributes.c:345 hfsplus_removexattr fs/hfsplus/xattr.c:792 [inline] __hfsplus_setxattr+0x801/0x2310 fs/hfsplus/xattr.c:275 hfsplus_setxattr+0x11c/0x180 fs/hfsplus/xattr.c:432 hfsplus_trusted_setxattr+0x40/0x60 fs/hfsplus/xattr_trusted.c:30 __vfs_removexattr+0x42a/0x460 fs/xattr.c:518 __vfs_removexattr_locked+0x206/0x450 fs/xattr.c:553 vfs_removexattr+0x103/0x2b0 fs/xattr.c:575 removexattr fs/xattr.c:1023 [inline] filename_removexattr fs/xattr.c:1052 [inline] path_removexattrat+0x32e/0x670 fs/xattr.c:1088 __do_sys_lremovexattr fs/xattr.c:1106 [inline] __se_sys_lremovexattr fs/xattr.c:1103 [inline] __x64_sys_lremovexattr+0x65/0x80 fs/xattr.c:1103 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb64af8d169 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:00007fb6473b3038 EFLAGS: 00000246 ORIG_RAX: 00000000000000c6 RAX: ffffffffffffffda RBX: 00007fb64b1a6160 RCX: 00007fb64af8d169 RDX: 0000000000000000 RSI: 00004000000000c0 RDI: 0000400000000240 RBP: 00007fb64b00e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007fb64b1a6160 R15: 00007ffc3180fa28 Allocated by task 5325: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4294 [inline] __kmalloc_noprof+0x285/0x4c0 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] __hfs_bnode_create+0xf8/0x770 fs/hfsplus/bnode.c:409 hfsplus_bnode_find+0x22b/0xe40 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x183/0x570 fs/hfsplus/bfind.c:172 hfsplus_attr_exists+0x15f/0x1d0 fs/hfsplus/attributes.c:182 __hfsplus_setxattr+0x476/0x2310 fs/hfsplus/xattr.c:336 hfsplus_setxattr+0x11c/0x180 fs/hfsplus/xattr.c:432 hfsplus_trusted_setxattr+0x40/0x60 fs/hfsplus/xattr_trusted.c:30 __vfs_setxattr+0x468/0x4a0 fs/xattr.c:200 __vfs_setxattr_noperm+0x12e/0x660 fs/xattr.c:234 vfs_setxattr+0x221/0x430 fs/xattr.c:321 do_setxattr fs/xattr.c:636 [inline] filename_setxattr+0x2af/0x430 fs/xattr.c:665 path_setxattrat+0x440/0x510 fs/xattr.c:713 __do_sys_setxattr fs/xattr.c:747 [inline] __se_sys_setxattr fs/xattr.c:743 [inline] __x64_sys_setxattr+0xbc/0xe0 fs/xattr.c:743 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888033d5b900 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 48 bytes to the right of allocated 152-byte region [ffff888033d5b900, ffff888033d5b998) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x33d5b flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801b0413c0 ffffea0000c2bf00 dead000000000004 raw: 0000000000000000 0000000000100010 00000000f5000000 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 13, tgid 13 (kworker/u4:1), ts 11105446606, free_ts 11084795798 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4740 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __kmalloc_cache_noprof+0x27b/0x390 mm/slub.c:4320 kmalloc_noprof include/linux/slab.h:901 [inline] blk_stat_alloc_callback+0x60/0x240 block/blk-stat.c:106 wbt_init+0x9f/0x510 block/blk-wbt.c:901 blk_register_queue+0x350/0x3d0 block/blk-sysfs.c:798 add_disk_fwnode+0x66d/0xfc0 block/genhd.c:505 sr_probe+0xc61/0x1690 drivers/scsi/sr.c:695 really_probe+0x2b9/0xad0 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 driver_probe_device+0x50/0x430 drivers/base/dd.c:830 page last free pid 1065 tgid 1065 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe0d/0x10e0 mm/page_alloc.c:2660 vfree+0x1c3/0x360 mm/vmalloc.c:3383 free_partitions block/partitions/core.c:113 [inline] blk_add_partitions block/partitions/core.c:638 [inline] bdev_disk_changed+0xefb/0x14d0 block/partitions/core.c:693 blkdev_get_whole+0x2d2/0x450 block/bdev.c:706 bdev_open+0x2d4/0xc50 block/bdev.c:915 bdev_file_open_by_dev+0x1b0/0x220 block/bdev.c:1017 disk_scan_partitions+0x1be/0x2b0 block/genhd.c:374 add_disk_fwnode+0xcc1/0xfc0 block/genhd.c:526 sd_probe+0xb9b/0x10d0 drivers/scsi/sd.c:4018 really_probe+0x2b9/0xad0 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 driver_probe_device+0x50/0x430 drivers/base/dd.c:830 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:958 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462 __device_attach_async_helper+0x22d/0x300 drivers/base/dd.c:987 async_run_entry_fn+0xa8/0x420 kernel/async.c:129 Memory state around the buggy address: ffff888033d5b880: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff888033d5b900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888033d5b980: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888033d5ba00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888033d5ba80: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ==================================================================