loop6: detected capacity change from 0 to 1024 ================================================================== BUG: KASAN: slab-out-of-bounds in hfsplus_uni2asc+0x576/0x11f0 fs/hfsplus/unicode.c:179 Read of size 2 at addr ffff88807c66740c by task syz.6.808/8382 CPU: 0 PID: 8382 Comm: syz.6.808 Tainted: G W 6.1.121-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:427 kasan_report+0x136/0x160 mm/kasan/report.c:531 hfsplus_uni2asc+0x576/0x11f0 fs/hfsplus/unicode.c:179 hfsplus_readdir+0x922/0x12c0 fs/hfsplus/dir.c:207 iterate_dir+0x224/0x560 __do_sys_getdents fs/readdir.c:286 [inline] __se_sys_getdents+0x1eb/0x4c0 fs/readdir.c:271 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fe3e7b85d29 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:00007fe3e8a47038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007fe3e7d75fa0 RCX: 00007fe3e7b85d29 RDX: 00000000000000b8 RSI: 0000000020001fc0 RDI: 0000000000000004 RBP: 00007fe3e7c01aa8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe3e7d75fa0 R15: 00007ffe97136438 Allocated by task 8382: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc+0xb2/0x230 mm/slab_common.c:949 kmalloc include/linux/slab.h:568 [inline] hfsplus_find_init+0x81/0x1c0 fs/hfsplus/bfind.c:21 hfsplus_readdir+0x207/0x12c0 fs/hfsplus/dir.c:144 iterate_dir+0x224/0x560 __do_sys_getdents fs/readdir.c:286 [inline] __se_sys_getdents+0x1eb/0x4c0 fs/readdir.c:271 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 call_rcu+0x163/0xa10 kernel/rcu/tree.c:2845 netlink_release+0x160b/0x1ab0 net/netlink/af_netlink.c:800 __sock_release net/socket.c:654 [inline] sock_close+0xcd/0x230 net/socket.c:1400 __fput+0x3f6/0x8d0 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:177 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88807c667000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1036 bytes inside of 2048-byte region [ffff88807c667000, ffff88807c667800) The buggy address belongs to the physical page: page:ffffea0001f19800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c660 head:ffffea0001f19800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888017c42000 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4249, tgid 4249 (syz-executor), ts 60430839137, free_ts 58182207669 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x3731/0x38d0 mm/page_alloc.c:4328 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5605 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node_track_caller+0xa0/0x220 mm/slab_common.c:956 kmalloc_reserve net/core/skbuff.c:446 [inline] pskb_expand_head+0x18c/0x10e0 net/core/skbuff.c:1848 netlink_trim+0x183/0x220 net/netlink/af_netlink.c:1293 netlink_broadcast+0x5b/0x10b0 net/netlink/af_netlink.c:1487 nlmsg_multicast include/net/netlink.h:1071 [inline] nlmsg_notify+0xfb/0x1c0 net/netlink/af_netlink.c:2536 register_netdevice+0x15f7/0x1920 net/core/dev.c:10206 register_netdev+0x37/0x50 net/core/dev.c:10287 vti6_init_net+0x20a/0x2c0 net/ipv6/ip6_vti.c:1164 ops_init+0x35d/0x610 net/core/net_namespace.c:138 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x12a6/0x15b0 mm/page_alloc.c:3384 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3479 __skb_frag_unref include/linux/skbuff.h:3436 [inline] skb_release_data+0x37f/0x7a0 net/core/skbuff.c:785 skb_release_all net/core/skbuff.c:856 [inline] __kfree_skb+0x4c/0x60 net/core/skbuff.c:870 tcp_clean_rtx_queue net/ipv4/tcp_input.c:3400 [inline] tcp_ack+0x246c/0x6e80 net/ipv4/tcp_input.c:3959 tcp_rcv_established+0xc51/0x1f00 net/ipv4/tcp_input.c:6086 tcp_v4_do_rcv+0x487/0xb00 net/ipv4/tcp_ipv4.c:1683 sk_backlog_rcv include/net/sock.h:1119 [inline] __release_sock+0x198/0x4b0 net/core/sock.c:2936 __sk_flush_backlog+0x22/0x30 net/core/sock.c:2956 sk_flush_backlog include/net/sock.h:1217 [inline] tcp_sendmsg_locked+0x314b/0x4100 net/ipv4/tcp.c:1328 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1490 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] sock_write_iter+0x394/0x4e0 net/socket.c:1143 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x857/0xbc0 fs/read_write.c:584 ksys_write+0x19c/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88807c667300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807c667380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807c667400: 00 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807c667480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807c667500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================