🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6366

[BUG] net: tun: zero-copy path can expose uninitialized packet data

#6366
From: Cheng Yongkang
Date: Thu, 22 Oct 2026 09:18
53 lines
12898 bytes
Hi all,

The experimental vhost-net TX zero-copy path can hand TUN a user buffer
whose effective vhost virtio header size is smaller than the TUN
device's configured vnet_hdr_sz.  TUN computes an skb copylen that
remains larger than the bytes actually available after stripping its
configured header, publishes skb->len from that copylen, and
zerocopy_sg_from_iter() initializes only the real payload.

The resulting frame contains an uninitialized tail.  The tail can be
read by userspace from the TAP peer through normal forwarding.

Observed on Linux v7.3, commit
08ab31164c55f20c7a2653de3186ae333470e2c1, with:

  init_on_alloc=0
  vhost_net.experimental_zcopytx=1
  TAP vnet_hdr_sz=200
  vhost TX total length=256
  real payload length=56
  TUN copylen / skb len=128

The exact control with vnet_hdr_sz=10 delivered the expected 246-byte
frame.  The corrected trigger delivered 128 bytes after submitting only
56 payload bytes.

Sixteen of sixteen corrected triggers produced the overlong skb.
Eleven of sixteen had nonzero bytes in the 72-byte uninitialized tail.
Several contained recognizable stale kernel allocation content from
previous skbuff_small_head users, including fragments of environment
entries.  Those bytes were never supplied in the virtio TX buffer.

This is a userspace-observable kernel-memory disclosure on a
network-forwarding path.  It is configuration-gated by experimental
zero-copy and an enlarged TAP vnet header, but the overlong skb occurs
regardless of init_on_alloc; init_on_alloc=0 is needed to observe the
stale tail in this test build.

This is distinct from candidate BR-023/BR-025, which exercise
IFF_NAPI_FRAGS.  This reproducer uses the non-frags tun_alloc_skb() /
zerocopy_sg_from_iter() branch.

I found no direct upstream fix or CVE.

The vhost ring reproducer and complete program/console logs are
available on request.

This was found with a multi-agent workflow; the
information disclosure was reproduced in QEMU/KVM.

Thanks,
Cheng Yongkang
Technical Details
Message-ID: <20261022091847.3654028-1-teel4res@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350469-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350469-linux-kernel-netdev=dewy.ru
From: teel4res@gmail.com (Cheng Yongkang)
Newsgroups: linux.kernel.netdev
Subject: [BUG] net: tun: zero-copy path can expose uninitialized packet data
Date: Thu, 22 Oct 2026 02:18:47 -0700
Organization: Usenet Network
Message-ID: <20261022091847.3654028-1-teel4res@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="175403"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jr6XE27AMPGJumtMlTHmX2QLz9w= sha256:o7deuv7JEJ4RHJpcvQg8UABGz8Js1c8tpvMv37knl08=
	sha1:8PTfn/eLb9Eqin8tOCtNMouPGZA= sha256:XCtPp4QCtLUE5Tv8JmkE+1Jhx3CjeIlfilUHEkUP3IE=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 3E3841111DC; Thu, 22 Oct 2026 12:30:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id k70YZ11gQgq3;
	Thu, 22 Oct 2026 12:30:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-350469-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 694E0111209; Thu, 22 Oct 2026 12:29:52 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id A0CF92B57B; Thu, 22 Oct 2026 09:19:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792660746;
	b=D8UOgccPzuTtdu33xv3kOXY1yBDVx+OTBvq0lACBr4tn1d3zeafBJGxhpJHBdNO0wkvj
	 CS7hwlFdpnar1R7TZ/rR7qJD+vOKvqUh1eJiCCu+biKlZUhWs8TkCK6Y+IIFt1vsKX1DB
	 9CXOHbLBlpVAVVsFC+ZdXFgC2DS7zut8X4dqBS8IIt8qgL8nuQz8Krej++9UEeSDfGUDB
	 4QCnThtYqG/cLnDpgMF8hXgw04JbcBtF0nNCcYCD6c9vpf+vhHvMF9aC3C5rp4jaUo/Om
	 4oNuSQ+eiuUfNKh4+JYS0ejTng1McPL/X/7ifkiEHFrpZUcabczyUZ+1D2k3X8OE+eA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792660746;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-Id:
	 X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=+3+RimD4u8oBrFVN6CFkCZt6Ny3U/0D/dKYnMLBj9z0=;
	b=UjGARBLmNo+P6+eR2jg6KiYHeJBzXZSp/X3tZ/pC3ESVgjaotNgG4G2yd1X6lmRbQ3zN
	 9TMVwJqvzyvoQOV0+CT3lgQKXDiWLJWi4b/fhIukJp+H7wtml/wg+K6llOz/dB/p4KA7c
	 Z4wS672YHfFOL5LsGbMG/ldrWTHXcvhyrEd+FRYkz4CuDgUzwonyFuoF+bF5sFIyGEcpB
	 tc/m5CoFtm/+Z8pavSR4wpU700yAX9q0rrhaHeXximXo8l/had0d2zV8W+TQZ+jTziT+q
	 9bNzh+Ci9/5P5ttb+eZR4C/UpL/9omQFNFB02++GkXxlrLoqjdD21HLdPjL+KBQtBiw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=e1FUsMFr;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 26CC6606A325;
	Thu, 22 Oct 2026 09:19:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=e1FUsMFr
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.41
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792660740;
	b=P6AI2lx4hZlEIOe+gb9zDjTl7Z+fk0XnuZygd0mbHrdUI4m8P0knL6UqvTgwc+oSoecV
	 tnVn3e1e8svy4VOD2B1yS3Zfht8aLqwQbfgElm3Y7yCtAUU8vZyqsZebuTrlA0gVCU4jV
	 0v2PdVdgArNR+yMgKe+40Mo3GP/jrzgdWzt3fB65L9SO1xo0TgR8rDD9s7yE3NDM8XYHG
	 78g5FLAbz4Y62b7+CfO68r4YOCIT+RnqWOzSJTLfu/VVBi1y7Xuy3HqC9ybYZ9JBCi33V
	 T/S41/k5oUBPn8tBDQ6ggfso4JVTDDwmBXmEZ0NtUd1JYnA62YZtSoXlTn27fxNh6Mg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792660740;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-Id:X-Mailer:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=+3+RimD4u8oBrFVN6CFkCZt6Ny3U/0D/dKYnMLBj9z0=;
	b=yO5c5Ly/J4QfemJn7dcoAw9JlJ3sdcnM2mta4PzmHry2cU4/Nt5cMiAWGd2oVpzyDY54
	 vVHs7Nvfva2l0Zko2VMCPXbQQLZII5w5NdL8xLoH7a0NMfpKpwFlk7BCYUyDabLd12SrM
	 SuAh00ygBPkM2poQaennRkdbaHg1aQzrmwdyKLMuSOla8Y88qP44qOng842lOZf24Z5S6
	 J0o3r+DZ7zgEfMAhpx+vcNDnHJvQDXsjnSdai0CUs5o6VyiYNST2HGaxapq6k7Q1bVCnJ
	 cqJHhYTzooIv2PAM2OsXYUZ4uZvBCby0LMLfYDO8qQBwZYid+BdHv1w8Fr04PN/yCTQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=e1FUsMFr;
	arc=none smtp.remote-ip=74.125.82.41
X-Received: from mail-dl1-f41.google.com (mail-dl1-f41.google.com [74.125.82.41])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDA22606A326
	for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 09:18:59 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EDA22606A326
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dl1-f41.google.com with SMTP id a92af1059eb24-16079d54c17so3058168c88.0
        for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 02:18:59 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792660738; x=1793265538; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=+3+RimD4u8oBrFVN6CFkCZt6Ny3U/0D/dKYnMLBj9z0=;
        b=e1FUsMFrTAW6QUpswIa27YiiEcGG5ijLLfxGR6RmpqWQsR4NH+jWQrxhV4Cd+WZeqY
         SilvJXZEpx8dcyIkaaG3dqf/oi7lQCdZL+hVZunr6sh4Xz9x5EkYUgclVMFHIEoFcMqR
         WqjZl8Cd1Grb3KGpm5TB3loCliDh2wioVKem9bzi8huMz+rIPBvWX4cJnJ0k659DA7Xc
         y5M61fbbg/QUgdxQdy5EkaEHvmYzS+AJBOM3weQgQR0F6yzcdhkdN6S25ZJY8SSkNGeh
         LVESuY1D4biD13sEGWrOUFQsr+/HnjxyVx0rlOXU2oXSzxWSKgm+Q6/OsvgJEdaxt2C3
         xorw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792660738; x=1793265538;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=+3+RimD4u8oBrFVN6CFkCZt6Ny3U/0D/dKYnMLBj9z0=;
        b=D2R0T8/xQRKGMPw6zv46Hhj5P0YYMFBNHYeA6NuRiulwLL6ykO2kK3+XH7Rh2hqihc
         VSoxNBaxJnnXeTNdJj7qt5QbSM0yoVjHZxHbJh1PbdvpFt6h4ZM1EcsBnkp3Xw+ytOAA
         ZPu4gxjGFtOxMlgirn/niVpv7SnRWQHKPX1x/bewMCiPgDuYVm+AvIccSLxPew3DsemC
         lArGPGqSc2P8rwZAzu8lKBzQva0k8AVtzwH62OtcPKNoSKGQQWY+5pGaWMv7Yw2A3QLM
         8Mpv/YYyXw0sv+ZNDgS6F7jANBxF9HTwFIHZo3VniQotCsQpqJYC71dzDE+L3FWeiN1x
         4aUg==
X-Forwarded-Encrypted: i=1; AKwUvBzUPpgxJPCqwxgLXHySKSPs6MAYZcHXOWXrPhbMhdap4XixMmHJZOcSD9iCLJHSQdpLmeynRlQ=@vger.kernel.org
X-Gm-Message-State: AFq9FYLZ7B8M/l+2n6QVEjlMiR2hDIdrpRRc+xp5+y/d/qdWKPsKzBy/
	lKXTkIVE1c0go1bzzGv3esAlYJ/HdWra/MH81lGXwnkM/ytUUbk+4czZ
X-Gm-Gg: AYBFou1UNQrner171RzTgTLv1BtgAu1VIQNWJ362ieMNIE855gPDYsgIwBL/9Lxbh4X
	i4HINCC068Z4B2Jlfm8h3l0/fBx/cWvjwXAtudNGsh60xm4vRDyEv4q68wFb/8GETzQzhOebCyV
	w6LWHmI1MlRTJeGhF4gSxFJ30/Q8FkJe1SMxNukDbjTTtocwBcSXaL8jBqDG6XD5kylDtuNCKQV
	Nep8T+iBQ1VL71Km4iJcGrkMFUwjF3tlOUtUir7VgJLAgTU0pfof3xbmiSdKOldJfWf1EM99c8k
	CijJZhc4yAks1ms382AqgpHgfpM+6Yp2NzMIr6GXiK9Vv6+wbrUoaNNkJL35SbM73ou2yyOLhF/
	nxEoFPauSfxdCRPl1alR20HoJRfQLejnmX1w/cP9yE6+SWaxwpwOAQ5SbNXBTBoNQpBQt/WLwcC
	QiZ/yr9P04iZZhDc9uZRLuI2HG9si7OGFTB+8JyVTAc9f+FTuWR6h3b9qklSu13q2He9Hyn1W/z
	qqtmY/gfUpWH0XkQNyci7o5h/cFfmPYPxXH1sdwzzddGvADRof2fnwJwX1oMv0Y0LHKWd46E1Au
	jnreI7kY2MuhN1xsBAJMkLSiNM0yV47EI6ceyvEI
X-Received: by 2002:a05:7022:ea57:b0:144:f089:b189 with SMTP id a92af1059eb24-190a74775b8mr5453836c88.36.1792660736253;
        Thu, 22 Oct 2026 02:18:56 -0700 (PDT)
X-Received: from youngkk-vm.localdomain (67.216.200.102.16clouds.com. [67.216.200.102])
        by smtp.gmail.com with ESMTPSA id a92af1059eb24-19035926035sm11607230c88.1.2026.10.22.02.18.51
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 22 Oct 2026 02:18:55 -0700 (PDT)
X-Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org,
	virtualization@lists.linux.dev,
	kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.34.1
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list