================================================================== BUG: KASAN: stack-out-of-bounds in string_nocheck lib/vsprintf.c:645 [inline] BUG: KASAN: stack-out-of-bounds in string+0x218/0x2b0 lib/vsprintf.c:727 Read of size 1 at addr ffffc90016116fc5 by task syz-executor.1/5337 CPU: 1 PID: 5337 Comm: syz-executor.1 Not tainted 6.6.0-syzkaller-05843-g89ed67ef126c #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+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 string_nocheck lib/vsprintf.c:645 [inline] string+0x218/0x2b0 lib/vsprintf.c:727 vsnprintf+0x10fc/0x1d80 lib/vsprintf.c:2818 vprintk_store+0x47f/0x1160 kernel/printk/printk.c:2191 vprintk_emit+0x119/0x720 kernel/printk/printk.c:2288 _printk+0xd5/0x120 kernel/printk/printk.c:2332 tcp_inbound_hash+0x9c1/0x1470 include/net/tcp.h:2760 tcp_v6_rcv+0x246a/0x3220 net/ipv6/tcp_ipv6.c:1882 ip6_protocol_deliver_rcu+0xb11/0x1310 net/ipv6/ip6_input.c:438 ip6_input_finish+0x186/0x2c0 net/ipv6/ip6_input.c:483 NF_HOOK+0x3a1/0x450 include/linux/netfilter.h:314 NF_HOOK+0x3a1/0x450 include/linux/netfilter.h:314 __netif_receive_skb_one_core net/core/dev.c:5527 [inline] __netif_receive_skb+0x1ca/0x530 net/core/dev.c:5641 netif_receive_skb_internal net/core/dev.c:5727 [inline] netif_receive_skb+0x1d8/0x7f0 net/core/dev.c:5786 tun_rx_batched+0x1b7/0x8f0 drivers/net/tun.c:1555 tun_get_user+0x2c79/0x4300 drivers/net/tun.c:2002 tun_chr_write_iter+0x113/0x1f0 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+0x792/0xb20 fs/read_write.c:584 ksys_write+0x1a0/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f70fc67b82f 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:00007f70fd46e090 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f70fc79bf80 RCX: 00007f70fc67b82f RDX: 000000000000008a RSI: 0000000020000200 RDI: 00000000000000c8 RBP: 00007f70fc6c847a R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000008a R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007f70fc79bf80 R15: 00007fff1278c928 The buggy address belongs to stack of task syz-executor.1/5337 and is located at offset 101 in frame: tcp_inbound_hash+0x0/0x1470 This frame has 5 objects: [32, 40) 'md5_tmp.i' [64, 72) 'ao_tmp.i' [96, 101) 'hdr_flags' [128, 133) 'hdr_flags94' [160, 165) 'hdr_flags331' The buggy address belongs to the virtual mapping at [ffffc90016110000, ffffc90016119000) created by: copy_process+0x5d1/0x4170 kernel/fork.c:2325 The buggy address belongs to the physical page: page:ffffea0001f42580 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7d096 memcg:ffff88807cf64c02 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88807cf64c02 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 5336, tgid 5336 (syz-executor.1), ts 1224646129960, free_ts 1222791400948 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0x9a3/0x1490 mm/vmalloc.c:3320 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct+0x3e5/0x7d0 kernel/fork.c:1118 copy_process+0x5d1/0x4170 kernel/fork.c:2325 kernel_clone+0x222/0x840 kernel/fork.c:2907 __do_sys_clone3 kernel/fork.c:3208 [inline] __se_sys_clone3+0x2cb/0x340 kernel/fork.c:3192 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x8c3/0x9f0 mm/page_alloc.c:2312 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2405 vfree+0x186/0x2e0 mm/vmalloc.c:2842 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:2763 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/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: ffffc90016116e80: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90016116f00: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 >ffffc90016116f80: 00 f2 f2 f2 00 f2 f2 f2 05 f2 f2 f2 05 f2 f2 f2 ^ ffffc90016117000: 05 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90016117080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================