From: Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,
netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org,
Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
Subject: [PATCH net v2 0/2] net: do not point a pskb copy's mac header into uninitialised headroom
Date: Tue, 17 Nov 2026 20:58:33 +0300 [thread overview]
Message-ID: <20261117175835.745796-1-theodorlarionov@gmail.com> (raw)
A pskb copy keeps the mac_header offset but not the headroom, so a copy
of a received packet has its mac header in uninitialised bytes, which
nft dup can return to userspace. Patch 2 unsets the mac header of such a
copy, as Florian suggested on v1. Patch 1 makes the nfnetlink_queue
bridge adjustment check the mac header first; without it, patch 2 turns
a queued GSO copy of a bridged packet into an out-of-bounds push.
v2: fix in __pskb_copy_fclone() instead of nf_dup; add patch 1.
v1: https://lore.kernel.org/netfilter-devel/20261116105113.128791-1-theodorlarionov@gmail.com/
Theodor Arsenij Larionov Trichkine (2):
netfilter: nfnetlink_queue: only adjust bridged skbs that have a mac
header
net: unset the mac header of a pskb copy that points into headroom
net/core/skbuff.c | 2 ++
net/netfilter/nfnetlink_queue.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
--
2.34.1
next reply other threads:[~2026-11-17 17:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 17:58 Theodor Arsenij Larionov Trichkine [this message]
2026-11-17 17:58 ` [PATCH net v2 1/2] netfilter: nfnetlink_queue: only adjust bridged skbs that have a mac header Theodor Arsenij Larionov Trichkine
2026-11-17 17:58 ` [PATCH net v2 2/2] net: unset the mac header of a pskb copy that points into headroom Theodor Arsenij Larionov Trichkine
2026-11-17 18:03 ` [PATCH net v2 0/2] net: do not point a pskb copy's mac header into uninitialised headroom netdev-bot+sinfo
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=20261117175835.745796-1-theodorlarionov@gmail.com \
--to=theodorlarionov@gmail.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
/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