================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_uni2asc+0x953/0xa50 fs/hfsplus/unicode.c:179 Read of size 2 at addr ffff8880142eb40c by task syz-executor320/4998 CPU: 0 PID: 4998 Comm: syz-executor320 Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 hfsplus_uni2asc+0x953/0xa50 fs/hfsplus/unicode.c:179 hfsplus_readdir+0x952/0xfd0 fs/hfsplus/dir.c:207 iterate_dir+0x56e/0x6f0 fs/readdir.c:65 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64 fs/readdir.c:354 [inline] __x64_sys_getdents64+0x13e/0x2c0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd222b78889 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc134c5498 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 000000000000003f RCX: 00007fd222b78889 RDX: 0000000000000061 RSI: 0000000020000340 RDI: 0000000000000004 RBP: 00007fd222b38120 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd222b381b0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 4998: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0x5e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] hfsplus_find_init+0x95/0x230 fs/hfsplus/bfind.c:21 hfsplus_readdir+0x21e/0xfd0 fs/hfsplus/dir.c:144 iterate_dir+0x56e/0x6f0 fs/readdir.c:65 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64 fs/readdir.c:354 [inline] __x64_sys_getdents64+0x13e/0x2c0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2627 netlink_release+0xcde/0x1e40 net/netlink/af_netlink.c:828 __sock_release+0xcd/0x290 net/socket.c:653 sock_close+0x1c/0x20 net/socket.c:1397 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880142eb000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes to the right of allocated 1036-byte region [ffff8880142eb000, ffff8880142eb40c) The buggy address belongs to the physical page: page:ffffea000050bac0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x142eb flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x1() raw: 00fff00000000200 ffff888012440800 ffffea000050b750 ffffea00005ef050 raw: 0000000000000000 ffff8880142eb000 0000000100000001 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 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 1, tgid 1 (swapper/0), ts 2487009578, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1360 [inline] cache_grow_begin+0x9b/0x3b0 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] __do_cache_alloc mm/slab.c:3201 [inline] slab_alloc_node mm/slab.c:3249 [inline] __kmem_cache_alloc_node+0x360/0x3f0 mm/slab.c:3540 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] acpi_os_allocate_zeroed include/acpi/platform/aclinuxex.h:57 [inline] acpi_ds_create_walk_state+0x7e/0x260 drivers/acpi/acpica/dswstate.c:518 acpi_ds_auto_serialize_method+0xef/0x260 drivers/acpi/acpica/dsmethod.c:81 acpi_ds_init_one_object drivers/acpi/acpica/dsinit.c:110 [inline] acpi_ds_init_one_object+0x359/0x450 drivers/acpi/acpica/dsinit.c:46 acpi_ns_walk_namespace+0x41d/0x5e0 drivers/acpi/acpica/nswalk.c:233 acpi_ds_initialize_objects+0x12f/0x190 drivers/acpi/acpica/dsinit.c:189 acpi_ns_load_table+0x9c/0x140 drivers/acpi/acpica/nsload.c:106 acpi_tb_load_namespace+0x26b/0x700 drivers/acpi/acpica/tbxfload.c:158 acpi_load_tables+0x2f/0x120 drivers/acpi/acpica/tbxfload.c:59 acpi_bus_init drivers/acpi/bus.c:1290 [inline] acpi_init+0x123/0xab0 drivers/acpi/bus.c:1402 page_owner free stack trace missing Memory state around the buggy address: ffff8880142eb300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880142eb380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880142eb400: 00 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880142eb480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880142eb500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================