loop0: detected capacity change from 0 to 1024 ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_uni2asc+0x680/0x1270 fs/hfsplus/unicode.c:179 Read of size 2 at addr ffff888045677a18 by task syz.0.0/5318 CPU: 0 UID: 0 PID: 5318 Comm: syz.0.0 Not tainted 6.15.0-syzkaller-07774-g90b83efa6701 #0 PREEMPT(full) 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_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xd2/0x2b0 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 hfsplus_uni2asc+0x680/0x1270 fs/hfsplus/unicode.c:179 hfsplus_listxattr+0x58e/0xb80 fs/hfsplus/xattr.c:734 vfs_listxattr fs/xattr.c:493 [inline] listxattr+0x10a/0x2a0 fs/xattr.c:924 filename_listxattr fs/xattr.c:958 [inline] path_listxattrat+0x179/0x3a0 fs/xattr.c:988 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fcf0178e969 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:00007fcf0259b038 EFLAGS: 00000246 ORIG_RAX: 00000000000000c2 RAX: ffffffffffffffda RBX: 00007fcf019b5fa0 RCX: 00007fcf0178e969 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000a00 RBP: 00007fcf01810ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fcf019b5fa0 R15: 00007fff05963818 Allocated by task 5318: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4327 [inline] __kmalloc_noprof+0x27a/0x4f0 mm/slub.c:4339 kmalloc_noprof include/linux/slab.h:909 [inline] hfsplus_find_init+0x8c/0x1d0 fs/hfsplus/bfind.c:21 hfsplus_listxattr+0x38f/0xb80 fs/hfsplus/xattr.c:693 vfs_listxattr fs/xattr.c:493 [inline] listxattr+0x10a/0x2a0 fs/xattr.c:924 filename_listxattr fs/xattr.c:958 [inline] path_listxattrat+0x179/0x3a0 fs/xattr.c:988 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888045677800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes to the right of allocated 536-byte region [ffff888045677800, ffff888045677a18) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x45674 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801a441dc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801a441dc0 dead000000000122 0000000000000000 head: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffea0001159d01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5318, tgid 5317 (syz.0.0), ts 68362975030, free_ts 67922273868 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1710 prep_new_page mm/page_alloc.c:1718 [inline] get_page_from_freelist+0x21e0/0x22c0 mm/page_alloc.c:3680 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2618 new_slab mm/slub.c:2672 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858 __slab_alloc mm/slub.c:3948 [inline] __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] __kmalloc_cache_noprof+0x296/0x3d0 mm/slub.c:4353 kmalloc_noprof include/linux/slab.h:905 [inline] hfsplus_getxattr+0x68/0x180 fs/hfsplus/xattr.c:580 vfs_getxattr_alloc+0x42e/0x580 fs/xattr.c:393 ima_read_xattr+0x38/0x60 security/integrity/ima/ima_appraise.c:230 process_measurement+0xfd7/0x1a40 security/integrity/ima/ima_main.c:366 ima_file_check+0xd7/0x120 security/integrity/ima/ima_main.c:613 security_file_post_open+0xbb/0x290 security/security.c:3130 do_open fs/namei.c:3889 [inline] path_openat+0x2f26/0x3830 fs/namei.c:4046 do_filp_open+0x1fa/0x410 fs/namei.c:4073 do_sys_openat2+0x121/0x1c0 fs/open.c:1437 page last free pid 5318 tgid 5317 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1254 [inline] __free_frozen_pages+0xc6e/0xe50 mm/page_alloc.c:2717 discard_slab mm/slub.c:2716 [inline] __put_partials+0x161/0x1c0 mm/slub.c:3185 put_cpu_partial+0x17c/0x250 mm/slub.c:3260 __slab_free+0x2f7/0x400 mm/slub.c:4512 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203 ptlock_alloc+0x20/0x70 mm/memory.c:7354 ptlock_init include/linux/mm.h:3074 [inline] pagetable_pte_ctor include/linux/mm.h:3122 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:73 [inline] pte_alloc_one+0x6d/0x160 arch/x86/mm/pgtable.c:18 __pte_alloc+0x25/0x1a0 mm/memory.c:430 do_anonymous_page mm/memory.c:4968 [inline] do_pte_missing mm/memory.c:4158 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x4b5f/0x55e0 mm/memory.c:6140 handle_mm_fault+0x40a/0x8e0 mm/memory.c:6309 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1336 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 Memory state around the buggy address: ffff888045677900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888045677980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888045677a00: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888045677a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888045677b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================