================================================================== 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 ffffc90009ae73f5 by task syz-executor.4/7220 CPU: 1 PID: 7220 Comm: syz-executor.4 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+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/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+0x3a0/0xb80 kernel/printk/printk.c:2191 vprintk_emit+0x14c/0x5f0 kernel/printk/printk.c:2288 vprintk+0x7b/0x90 kernel/printk/printk_safe.c:45 _printk+0xc8/0x100 kernel/printk/printk.c:2332 tcp_inbound_hash.constprop.0+0xdb2/0x10d0 include/net/tcp.h:2760 tcp_v6_rcv+0x2b31/0x34d0 net/ipv6/tcp_ipv6.c:1882 ip6_protocol_deliver_rcu+0x33b/0x13d0 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+0x133/0x700 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+0x64f/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+0x63/0x6b RIP: 0033:0x7f02da27b82f 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:00007f02d8dfe090 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f02da39bf80 RCX: 00007f02da27b82f RDX: 000000000000008a RSI: 0000000020000200 RDI: 00000000000000c8 RBP: 00007f02da2c847a R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000008a R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007f02da39bf80 R15: 00007ffd7a4e7858 The buggy address belongs to stack of task syz-executor.4/7220 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 [ffffc90009ae0000, ffffc90009ae9000) created by: kernel_clone+0xfd/0x920 kernel/fork.c:2907 The buggy address belongs to the physical page: page:ffffea00008141c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20507 memcg:ffff88801f85c882 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88801f85c882 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 7217, tgid 7217 (syz-executor.4), ts 1331710710257, free_ts 1317327549477 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2303 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0x8f3/0x1bf0 mm/vmalloc.c:3320 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct kernel/fork.c:1118 [inline] copy_process+0x13e3/0x73f0 kernel/fork.c:2325 kernel_clone+0xfd/0x920 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+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+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 vfree mm/vmalloc.c:2842 [inline] vfree+0x3fb/0xe40 mm/vmalloc.c:2807 snd_dma_free_pages+0xcf/0x130 sound/core/memalloc.c:126 do_free_pages sound/core/pcm_memory.c:93 [inline] do_free_pages sound/core/pcm_memory.c:88 [inline] snd_pcm_lib_free_pages+0x216/0x450 sound/core/pcm_memory.c:499 do_hw_free sound/core/pcm_native.c:876 [inline] snd_pcm_release_substream.part.0+0x29c/0x330 sound/core/pcm_native.c:2709 snd_pcm_release_substream+0x5b/0x70 sound/core/pcm_native.c:2703 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2413 [inline] snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2405 [inline] snd_pcm_oss_release+0x13b/0x310 sound/core/oss/pcm_oss.c:2592 __fput+0x270/0xbb0 fs/file_table.c:394 __fput_sync+0x47/0x50 fs/file_table.c:475 __do_sys_close fs/open.c:1590 [inline] __se_sys_close fs/open.c:1575 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1575 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+0x63/0x6b Memory state around the buggy address: ffffc90009ae7280: 00 f1 f1 f1 f1 00 00 00 f3 f3 f3 f3 f3 00 00 00 ffffc90009ae7300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90009ae7380: 00 00 f1 f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 05 f3 ^ ffffc90009ae7400: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90009ae7480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================