From: Florian Westphal <fw@strlen.de>
To: Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
Phil Sutter <phil@nwl.cc>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nf_dup: unset mac_header on the duplicated packet
Date: Mon, 16 Nov 2026 14:39:16 +0100 [thread overview]
Message-ID: <avsHhMbvwwfcI6_b@strlen.de> (raw)
In-Reply-To: <20261116105113.128791-1-theodorlarionov@gmail.com>
Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com> wrote:
> nf_dup_ipv4() and nf_dup_ipv6() duplicate the packet with pskb_copy(),
> which leaves the headroom uninitialised but keeps the mac_header offset.
> On LOCAL_OUT and POST_ROUTING, an nft payload read of the link-layer
> header of the copy loads those bytes, and a set element can return them
> to userspace:
>
> BUG: KMSAN: kernel-infoleak in _copy_to_iter
>
> Unset the mac header of the copy, as for a locally generated packet.
Why force users to work around this? I think it would make more sense
to __pskb_copy_fclone() to check if the copied mac_header offset is
now in uninitialised headroom and then resets it.
Otherwise we might have more places that need fixing, resp. will
re-introduce this issue in the future.
prev parent reply other threads:[~2026-11-16 13:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 10:51 [PATCH nf] netfilter: nf_dup: unset mac_header on the duplicated packet Theodor Arsenij Larionov Trichkine
2026-11-16 13:39 ` Florian Westphal [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=avsHhMbvwwfcI6_b@strlen.de \
--to=fw@strlen.de \
--cc=coreteam@netfilter.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
--cc=theodorlarionov@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.