================================================================== BUG: KASAN: stack-out-of-bounds in string_nocheck lib/vsprintf.c:646 [inline] BUG: KASAN: stack-out-of-bounds in string+0x394/0x3d0 lib/vsprintf.c:728 Read of size 1 at addr ffffc9000a5573ed by task syz-executor.1/939 CPU: 0 PID: 939 Comm: syz-executor.1 Not tainted 6.6.0-next-20231103-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc3/0x620 mm/kasan/report.c:475 kasan_report+0xd9/0x110 mm/kasan/report.c:588 string_nocheck lib/vsprintf.c:646 [inline] string+0x394/0x3d0 lib/vsprintf.c:728 vsnprintf+0xc5f/0x1870 lib/vsprintf.c:2819 vprintk_store+0x39f/0xb80 kernel/printk/printk.c:2187 vprintk_emit+0x14c/0x5f0 kernel/printk/printk.c:2284 vprintk+0x7b/0x90 kernel/printk/printk_safe.c:45 _printk+0xc8/0x100 kernel/printk/printk.c:2328 tcp_inbound_hash.constprop.0+0xdb2/0x10d0 include/net/tcp.h:2760 tcp_v6_rcv+0x2b2e/0x34d0 net/ipv6/tcp_ipv6.c:1882 ip6_protocol_deliver_rcu+0x33b/0x13c0 net/ipv6/ip6_input.c:438 ip6_input_finish+0x14f/0x2f0 net/ipv6/ip6_input.c:483 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ip6_input+0xce/0x440 net/ipv6/ip6_input.c:492 dst_input include/net/dst.h:461 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:79 [inline] NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ipv6_rcv+0x563/0x720 net/ipv6/ip6_input.c:310 __netif_receive_skb_one_core+0x115/0x180 net/core/dev.c:5527 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:5641 netif_receive_skb_internal net/core/dev.c:5727 [inline] netif_receive_skb+0x13f/0x710 net/core/dev.c:5786 tun_rx_batched+0x429/0x780 drivers/net/tun.c:1579 tun_get_user+0x29e3/0x3bc0 drivers/net/tun.c:2002 tun_chr_write_iter+0xe8/0x210 drivers/net/tun.c:2048 call_write_iter include/linux/fs.h:2020 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x64d/0xdf0 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a RIP: 0033:0x7f8e4cc7b82f Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 b9 80 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 0c 81 02 00 48 RSP: 002b:00007f8e4d8f9090 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f8e4cd9bf80 RCX: 00007f8e4cc7b82f RDX: 00000000000000ca RSI: 0000000020000a00 RDI: 00000000000000c8 RBP: 00007f8e4ccc847a R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000000ca R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007f8e4cd9bf80 R15: 00007fff3992f5b8 The buggy address belongs to stack of task syz-executor.1/939 and is located at offset 101 in frame: tcp_inbound_hash.constprop.0+0x0/0x10d0 include/net/net_namespace.h:385 This frame has 3 objects: [32, 40) 'md5_tmp' [64, 72) 'ao_tmp' [96, 101) 'hdr_flags' The buggy address belongs to the virtual mapping at [ffffc9000a550000, ffffc9000a559000) created by: kernel_clone+0xfd/0x940 kernel/fork.c:2907 The buggy address belongs to the physical page: page:ffffea0001dcfc80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x773f2 memcg:ffff888079d21702 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888079d21702 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 930, tgid 930 (syz-executor.5), ts 3637444612842, free_ts 3635770865871 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa16/0x3680 mm/page_alloc.c:3348 __alloc_pages+0x1cf/0x4c0 mm/page_alloc.c:4604 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0x8f2/0x1be0 mm/vmalloc.c:3320 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct kernel/fork.c:1118 [inline] copy_process+0x13da/0x7470 kernel/fork.c:2332 kernel_clone+0xfd/0x940 kernel/fork.c:2907 __do_sys_clone3+0x1f1/0x260 kernel/fork.c:3208 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2383 free_unref_page_list+0xe6/0xb40 mm/page_alloc.c:2569 release_pages+0x32a/0x14e0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98 tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu mm/mmu_gather.c:300 [inline] tlb_finish_mmu+0x14b/0x6f0 mm/mmu_gather.c:392 exit_mmap+0x38b/0xa70 mm/mmap.c:3321 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9a1/0x2ac0 kernel/exit.c:858 __do_sys_exit kernel/exit.c:988 [inline] __se_sys_exit kernel/exit.c:986 [inline] __x64_sys_exit+0x42/0x50 kernel/exit.c:986 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a Memory state around the buggy address: ffffc9000a557280: f1 f1 f1 f1 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 ffffc9000a557300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9000a557380: 00 f1 f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 05 f3 f3 ^ ffffc9000a557400: f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000a557480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================