From: patchwork-bot+netdevbpf@kernel.org
To: Xiang Mei <xmei5@asu.edu>
Cc: netdev@vger.kernel.org, willemdebruijn.kernel@gmail.com,
jasowang@redhat.com, pabeni@redhat.com, andrew+netdev@lunn.ch,
edumazet@google.com, kuba@kernel.org, bestswngs@gmail.com
Subject: Re: [PATCH net] tun: zero the whole vnet header in tun_put_user()
Date: Wed, 10 Jun 2026 01:50:11 +0000 [thread overview]
Message-ID: <178105621163.2788910.10891803539978570037.git-patchwork-notify@kernel.org> (raw)
In-Reply-To: <20260607054428.3050243-1-xmei5@asu.edu>
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 6 Jun 2026 22:44:28 -0700 you wrote:
> tun_put_user() declares an on-stack struct virtio_net_hdr_v1_hash_tunnel
> without zeroing it. For a non-tunnel skb, virtio_net_hdr_tnl_from_skb()
> only initializes the first 10 bytes (sizeof(struct virtio_net_hdr)),
> leaving bytes 10..23 (num_buffers and the hash/tunnel fields) as stack
> garbage.
>
> An unprivileged user can set the vnet header size to 24 with
> TUNSETVNETHDRSZ, so __tun_vnet_hdr_put() copies all 24 bytes of the
> partially-initialized struct to userspace, leaking 14 bytes of kernel
> stack on every read of a non-tunnel packet.
>
> [...]
Here is the summary with links:
- [net] tun: zero the whole vnet header in tun_put_user()
https://git.kernel.org/netdev/net/c/7f2fcff15e99
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
prev parent reply other threads:[~2026-06-10 1:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-07 5:44 [PATCH net] tun: zero the whole vnet header in tun_put_user() Xiang Mei
2026-06-07 5:47 ` Xiang Mei
2026-06-07 21:12 ` Willem de Bruijn
2026-06-08 1:00 ` Xiang Mei
2026-06-10 1:50 ` patchwork-bot+netdevbpf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178105621163.2788910.10891803539978570037.git-patchwork-notify@kernel.org \
--to=patchwork-bot+netdevbpf@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bestswngs@gmail.com \
--cc=edumazet@google.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=xmei5@asu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox