================================================================== BUG: KASAN: stack-out-of-bounds in string_nocheck lib/vsprintf.c:645 [inline] BUG: KASAN: stack-out-of-bounds in string+0x394/0x3d0 lib/vsprintf.c:727 Read of size 1 at addr ffffc9001461f3ed by task syz-executor.2/30365 CPU: 0 PID: 30365 Comm: syz-executor.2 Not tainted 6.6.0-next-20231101-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:645 [inline] string+0x394/0x3d0 lib/vsprintf.c:727 vsnprintf+0xc5f/0x1870 lib/vsprintf.c:2818 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:0x7fdc8f47b82f 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:00007fdc9029d090 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fdc8f59bf80 RCX: 00007fdc8f47b82f RDX: 000000000000008a RSI: 0000000020000200 RDI: 00000000000000c8 RBP: 00007fdc8f4c847a R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000008a R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007fdc8f59bf80 R15: 00007fff45b850e8 The buggy address belongs to stack of task syz-executor.2/30365 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 [ffffc90014618000, ffffc90014621000) created by: kernel_clone+0xfd/0x940 kernel/fork.c:2907 The buggy address belongs to the physical page: page:ffffea0001ea4b40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a92d memcg:ffff88801f152e82 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88801f152e82 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 30362, tgid 30362 (syz-executor.2), ts 2943477282030, free_ts 2943266131245 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+0x33/0x3b0 mm/page_alloc.c:2523 vfree mm/vmalloc.c:2842 [inline] vfree+0x3fb/0xe40 mm/vmalloc.c:2807 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:2763 process_one_work+0x8a2/0x15e0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b6/0x1280 kernel/workqueue.c:2784 kthread+0x337/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Memory state around the buggy address: ffffc9001461f280: f1 f1 f1 f1 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 ffffc9001461f300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9001461f380: 00 f1 f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 05 f3 f3 ^ ffffc9001461f400: f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9001461f480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================