================================================================== 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 ffffc9000221f3fd by task syz-executor.0/4696 CPU: 1 PID: 4696 Comm: syz-executor.0 Not tainted 6.6.0-rc7-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+0x8e/0xf0 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+0xcde/0x1910 lib/vsprintf.c:2818 vprintk_store+0x397/0xac0 kernel/printk/printk.c:2191 vprintk_emit+0x142/0x4e0 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+0xcb9/0x1030 include/net/tcp.h:2752 tcp_v6_rcv+0x2f33/0x36f0 net/ipv6/tcp_ipv6.c:1865 ip6_protocol_deliver_rcu+0x16b/0x12a0 net/ipv6/ip6_input.c:438 ip6_input_finish+0x131/0x1c0 net/ipv6/ip6_input.c:483 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ip6_input+0xca/0x230 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+0x3aa/0x4b0 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+0xff/0x500 net/core/dev.c:5786 tun_rx_batched+0x422/0x770 drivers/net/tun.c:1579 tun_get_user+0x2684/0x32e0 drivers/net/tun.c:2002 tun_chr_write_iter+0xe8/0x210 drivers/net/tun.c:2048 call_write_iter include/linux/fs.h:1956 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x63c/0xce0 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fa0dfe7b82f 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:00007fa0e0c83090 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa0dff9bf80 RCX: 00007fa0dfe7b82f RDX: 000000000000008a RSI: 00000000200002c0 RDI: 00000000000000c8 RBP: 00007fa0dfec847a R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000008a R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007fa0dff9bf80 R15: 00007ffca86da928 The buggy address belongs to stack of task syz-executor.0/4696 and is located at offset 101 in frame: tcp_inbound_hash.constprop.0+0x0/0x1030 net/ipv4/tcp_ipv4.c:1513 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 [ffffc90002218000, ffffc90002221000) created by: kernel_clone+0xfd/0xab0 kernel/fork.c:2909 The buggy address belongs to the physical page: page:ffffea000464e240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x119389 memcg:ffff888106e6da02 flags: 0x100000000000000(node=0|zone=2) page_type: 0xffffffff() raw: 0100000000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888106e6da02 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 1957, tgid 1957 (kworker/u4:7), ts 87842847477, free_ts 83818198241 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x27e/0x2f0 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xe91/0x30a0 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x470 mm/page_alloc.c:4426 alloc_pages+0x21f/0x3e0 mm/mempolicy.c:2299 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0xa46/0x1510 mm/vmalloc.c:3320 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct kernel/fork.c:1118 [inline] copy_process+0x1213/0x6b10 kernel/fork.c:2327 kernel_clone+0xfd/0xab0 kernel/fork.c:2909 user_mode_thread+0xb4/0xf0 kernel/fork.c:2987 call_usermodehelper_exec_sync kernel/umh.c:133 [inline] call_usermodehelper_exec_work+0x6b/0x170 kernel/umh.c:164 process_one_work+0x7eb/0x13e0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x86f/0x1160 kernel/workqueue.c:2784 kthread+0x2aa/0x380 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:304 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+0x503/0xb90 mm/page_alloc.c:2312 free_unref_page+0x33/0x350 mm/page_alloc.c:2405 kasan_depopulate_vmalloc_pte+0x63/0x80 mm/kasan/shadow.c:427 apply_to_pte_range mm/memory.c:2589 [inline] apply_to_pmd_range mm/memory.c:2633 [inline] apply_to_pud_range mm/memory.c:2669 [inline] apply_to_p4d_range mm/memory.c:2705 [inline] __apply_to_page_range+0x4e6/0xcd0 mm/memory.c:2739 kasan_release_vmalloc+0xa8/0xc0 mm/kasan/shadow.c:544 __purge_vmap_area_lazy+0x8d6/0x20b0 mm/vmalloc.c:1770 _vm_unmap_aliases+0x29a/0xa80 mm/vmalloc.c:2306 change_page_attr_set_clr+0x248/0x490 arch/x86/mm/pat/set_memory.c:1838 change_page_attr_clear arch/x86/mm/pat/set_memory.c:1886 [inline] set_memory_ro+0x7c/0xa0 arch/x86/mm/pat/set_memory.c:2077 bpf_prog_lock_ro include/linux/filter.h:889 [inline] bpf_prog_select_runtime+0x4ec/0x620 kernel/bpf/core.c:2367 bpf_migrate_filter net/core/filter.c:1301 [inline] bpf_prepare_filter+0xcee/0x10a0 net/core/filter.c:1349 bpf_prog_create_from_user+0x1e4/0x2d0 net/core/filter.c:1443 seccomp_prepare_filter kernel/seccomp.c:680 [inline] seccomp_prepare_user_filter kernel/seccomp.c:717 [inline] seccomp_set_mode_filter kernel/seccomp.c:1935 [inline] do_seccomp+0x7b7/0x2560 kernel/seccomp.c:2055 prctl_set_seccomp+0x4b/0x70 kernel/seccomp.c:2108 __do_sys_prctl+0xf57/0x18e0 kernel/sys.c:2490 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffffc9000221f280: 00 00 f1 f1 f1 f1 00 00 00 f3 f3 f3 f3 f3 00 00 ffffc9000221f300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9000221f380: 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 05 ^ ffffc9000221f400: f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000221f480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================