hfsplus: bad catalog entry type ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_uni2asc+0x57f/0x1200 fs/hfsplus/unicode.c:179 Read of size 2 at addr ffff88801268d40c by task syz-executor.2/11789 CPU: 1 PID: 11789 Comm: syz-executor.2 Not tainted 6.9.0-rc4-next-20240418-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 hfsplus_uni2asc+0x57f/0x1200 fs/hfsplus/unicode.c:179 hfsplus_readdir+0x93b/0x1320 fs/hfsplus/dir.c:207 iterate_dir+0x65e/0x820 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:394 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5b37ca93a3 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 52 8b fa ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 b0 ff ff ff f7 d8 RSP: 002b:00007ffdde718eb8 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00005555873d7970 RCX: 00007f5b37ca93a3 RDX: 0000000000008000 RSI: 00005555873d7970 RDI: 0000000000000005 RBP: 00005555873d7944 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000293 R12: ffffffffffffffb0 R13: 0000000000000016 R14: 00005555873d7940 R15: 0000000000000009 Allocated by task 11789: 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:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4078 [inline] __kmalloc_noprof+0x200/0x400 mm/slub.c:4091 kmalloc_noprof include/linux/slab.h:664 [inline] hfsplus_find_init+0x85/0x1c0 fs/hfsplus/bfind.c:21 hfsplus_readdir+0x20e/0x1320 fs/hfsplus/dir.c:144 iterate_dir+0x65e/0x820 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:394 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88801268d000 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 [ffff88801268d000, ffff88801268d40c) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888012688000 pfn:0x12688 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff80000000040(head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000040 ffff888015042000 0000000000000000 dead000000000001 raw: ffff888012688000 0000000080080007 00000001ffffefff 0000000000000000 head: 00fff80000000040 ffff888015042000 0000000000000000 dead000000000001 head: ffff888012688000 0000000080080007 00000001ffffefff 0000000000000000 head: 00fff80000000003 ffffea000049a201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 11, tgid 359583029 (kworker/u8:0), ts 11, free_ts 245081816142 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1476 prep_new_page mm/page_alloc.c:1484 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4704 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2259 allocate_slab+0x5a/0x2e0 mm/slub.c:2422 new_slab mm/slub.c:2475 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3624 __slab_alloc+0x58/0xa0 mm/slub.c:3714 __slab_alloc_node mm/slub.c:3767 [inline] slab_alloc_node mm/slub.c:3945 [inline] __do_kmalloc_node mm/slub.c:4077 [inline] kmalloc_node_track_caller_noprof+0x286/0x440 mm/slub.c:4098 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:600 pskb_expand_head+0x1f0/0x13d0 net/core/skbuff.c:2189 netlink_trim+0x183/0x220 net/netlink/af_netlink.c:1317 netlink_broadcast_filtered+0x76/0x1290 net/netlink/af_netlink.c:1523 nlmsg_multicast_filtered include/net/netlink.h:1125 [inline] nlmsg_multicast include/net/netlink.h:1144 [inline] nlmsg_notify+0xfb/0x1c0 net/netlink/af_netlink.c:2602 unregister_netdevice_many_notify+0x111d/0x16e0 net/core/dev.c:11201 cleanup_net+0x75d/0xcc0 net/core/net_namespace.c:632 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 page last free pid 11 tgid 11 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1096 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2609 discard_slab mm/slub.c:2521 [inline] __put_partials+0xeb/0x130 mm/slub.c:2989 put_cpu_partial+0x17c/0x250 mm/slub.c:3064 __slab_free+0x2ea/0x3d0 mm/slub.c:4263 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3897 [inline] slab_alloc_node mm/slub.c:3957 [inline] kmem_cache_alloc_node_noprof+0x16b/0x310 mm/slub.c:4000 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:659 alloc_skb include/linux/skbuff.h:1313 [inline] nlmsg_new include/net/netlink.h:1015 [inline] inet6_netconf_notify_devconf+0xfc/0x1c0 net/ipv6/addrconf.c:589 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7251 [inline] addrconf_sysctl_unregister net/ipv6/addrconf.c:7275 [inline] addrconf_ifdown+0x187e/0x1bc0 net/ipv6/addrconf.c:4008 addrconf_notify+0x3cb/0x1020 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:2016 [inline] call_netdevice_notifiers net/core/dev.c:2030 [inline] unregister_netdevice_many_notify+0xd9b/0x16e0 net/core/dev.c:11178 cleanup_net+0x75d/0xcc0 net/core/net_namespace.c:632 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 Memory state around the buggy address: ffff88801268d300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801268d380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88801268d400: 00 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801268d480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801268d500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================