================================================================== 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 ffffc9000c03efc5 by task syz-executor.3/30594 CPU: 1 PID: 30594 Comm: syz-executor.3 Not tainted 6.6.0-syzkaller-12401-g8f6f76a6a29f #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+0x142/0x170 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:0x7f7be487b82f 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:00007f7be5602090 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f7be499bf80 RCX: 00007f7be487b82f RDX: 000000000000009e RSI: 0000000020000280 RDI: 00000000000000c8 RBP: 00007f7be48c847a R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000009e R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007f7be499bf80 R15: 00007ffd15877ed8 The buggy address belongs to stack of task syz-executor.3/30594 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 [ffffc9000c038000, ffffc9000c041000) created by: copy_process+0x5d1/0x3fb0 kernel/fork.c:2332 The buggy address belongs to the physical page: page:ffffea0000de5c80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x37972 memcg:ffff888015ee0182 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888015ee0182 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 30576, tgid 30576 (syz-executor.1), ts 2212348206552, free_ts 2210355510396 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x339a/0x3530 mm/page_alloc.c:3312 __alloc_pages+0x255/0x670 mm/page_alloc.c:4568 alloc_pages_mpol+0x3de/0x640 mm/mempolicy.c:2133 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/0x3fb0 kernel/fork.c:2332 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:1137 [inline] free_unref_page_prepare+0x92a/0xa50 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 discard_slab mm/slub.c:2116 [inline] __unfreeze_partials+0x1dc/0x220 mm/slub.c:2655 put_cpu_partial+0x17b/0x250 mm/slub.c:2731 __slab_free+0x2b6/0x390 mm/slub.c:3679 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x6c/0x3c0 mm/slab.h:763 slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x1d0/0x300 mm/slub.c:3517 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] kobject_uevent_env+0x285/0x8e0 lib/kobject_uevent.c:524 device_del+0x7bf/0x9d0 drivers/base/core.c:3831 remove_one_compat_dev drivers/infiniband/core/device.c:1003 [inline] rdma_dev_exit_net+0x1fb/0x350 drivers/infiniband/core/device.c:1140 ops_exit_list net/core/net_namespace.c:170 [inline] cleanup_net+0x6d2/0xb80 net/core/net_namespace.c:614 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 Memory state around the buggy address: ffffc9000c03ee80: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000c03ef00: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 >ffffc9000c03ef80: 00 f2 f2 f2 00 f2 f2 f2 05 f2 f2 f2 05 f2 f2 f2 ^ ffffc9000c03f000: 05 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000c03f080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================