================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_uni2asc+0x576/0x11f0 fs/hfsplus/unicode.c:179 Read of size 2 at addr ffff88807996a40c by task syz-executor.4/6234 CPU: 0 PID: 6234 Comm: syz-executor.4 Not tainted 5.15.120-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 hfsplus_uni2asc+0x576/0x11f0 fs/hfsplus/unicode.c:179 hfsplus_readdir+0x90c/0x12f0 fs/hfsplus/dir.c:207 iterate_dir+0x224/0x570 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fe6b05a2389 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe6aeb14168 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007fe6b06c1f80 RCX: 00007fe6b05a2389 RDX: 0000000000000067 RSI: 0000000020000540 RDI: 0000000000000003 RBP: 00007fe6b05ed493 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc5d1bad2f R14: 00007fe6aeb14300 R15: 0000000000022000 Allocated by task 6234: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] hfsplus_find_init+0x81/0x1c0 fs/hfsplus/bfind.c:21 hfsplus_readdir+0x204/0x12f0 fs/hfsplus/dir.c:144 iterate_dir+0x224/0x570 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2994 [inline] call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3074 netlink_release+0x1362/0x17c0 net/netlink/af_netlink.c:819 __sock_release net/socket.c:649 [inline] sock_close+0xcd/0x230 net/socket.c:1317 __fput+0x3bf/0x890 fs/file_table.c:280 task_work_run+0x129/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:175 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb Second to last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2994 [inline] call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3074 in6_dev_put include/net/addrconf.h:378 [inline] in6_dev_put_clear include/net/addrconf.h:386 [inline] ip6_route_dev_notify+0x4f9/0x5f0 net/ipv6/route.c:6315 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:1998 [inline] call_netdevice_notifiers_extack net/core/dev.c:2010 [inline] call_netdevice_notifiers net/core/dev.c:2024 [inline] unregister_netdevice_many+0xf1b/0x18f0 net/core/dev.c:11067 default_device_exit_batch+0x390/0x3f0 net/core/dev.c:11596 ops_exit_list net/core/net_namespace.c:174 [inline] cleanup_net+0x763/0xb60 net/core/net_namespace.c:596 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307 worker_thread+0xaca/0x1280 kernel/workqueue.c:2454 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff88807996a000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1036 bytes inside of 2048-byte region [ffff88807996a000, ffff88807996a800) The buggy address belongs to the page: page:ffffea0001e65a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79968 head:ffffea0001e65a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000100000001 ffff888011c42000 raw: 0000000000000000 0000000080080008 00000001ffffffff 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3546, ts 269305373756, free_ts 269287068363 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node_track_caller+0x1f6/0x390 mm/slub.c:4958 kmalloc_reserve net/core/skbuff.c:356 [inline] __alloc_skb+0x12c/0x590 net/core/skbuff.c:427 alloc_skb include/linux/skbuff.h:1167 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet6_ifinfo_notify+0x69/0x110 net/ipv6/addrconf.c:6040 addrconf_notify+0xc0d/0xf30 net/ipv6/addrconf.c:3658 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391 __dev_notify_flags+0x304/0x610 dev_change_flags+0xe7/0x190 net/core/dev.c:8863 do_setlink+0xcd1/0x3ae0 net/core/rtnetlink.c:2721 __rtnl_newlink net/core/rtnetlink.c:3401 [inline] rtnl_newlink+0x177d/0x2060 net/core/rtnetlink.c:3516 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5593 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587 do_slab_free mm/slub.c:3487 [inline] ___cache_free+0xe3/0x100 mm/slub.c:3506 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] kmem_cache_alloc_node+0x121/0x2c0 mm/slub.c:3256 __alloc_skb+0xdd/0x590 net/core/skbuff.c:415 alloc_skb include/linux/skbuff.h:1167 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1202 [inline] netlink_sendmsg+0x6f8/0xd60 net/netlink/af_netlink.c:1898 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] __sys_sendto+0x564/0x720 net/socket.c:2039 __do_sys_sendto net/socket.c:2051 [inline] __se_sys_sendto net/socket.c:2047 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2047 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88807996a300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807996a380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807996a400: 00 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807996a480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807996a500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================