From: Florian Westphal <fw@strlen.de>
To: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
pablo@netfilter.org, phil@nwl.cc, VEGA <vega@nebusec.ai>
Subject: Re: [PATCH nf] netfilter: nfnetlink_queue: keep socket ownership when expanding skb
Date: Fri, 30 Oct 2026 15:35:56 +0100 [thread overview]
Message-ID: <auSrTEnc8tibSGs2@strlen.de> (raw)
In-Reply-To: <20261030135750.4452-1-fmancera@suse.de>
Fernando Fernandez Mancera <fmancera@suse.de> wrote:
> nfqnl_mangle() replaces the skb with skb_copy_expand() when a verdict
> grows a packet beyond its tailroom. skb_copy_expand() does not copy
> skb->sk, so the replacement is unowned and freeing the original drops
> its socket memory charge.
>
> The expanded packet is no longer associated with the process that sent
> it. Therefore xt_owner or xt_cgroup and other socket based matches in
> later rules no longer matches and a later NFQUEUE reports no uid/gid. In
> addition, the expanded packet's memory is not counted towards the
> sender's SO_SNDBUF limit, so the sender can keep producing them while
> they sit in a queue.
A proper fix requires wmem/truesize fixups and will have to deal with
wmem-accounted vs. non-wmem accounted.
I dont think its worth fixing this, there are many other ways to
get OOM when you have CAP_NET_ADMIN.
next prev parent reply other threads:[~2026-10-30 14:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 13:57 [PATCH nf] netfilter: nfnetlink_queue: keep socket ownership when expanding skb Fernando Fernandez Mancera
2026-10-30 14:35 ` Florian Westphal [this message]
2026-10-30 14:40 ` Fernando Fernandez Mancera
2026-10-30 14:53 ` Florian Westphal
2026-10-30 14:57 ` Fernando Fernandez Mancera
2026-10-30 15:07 ` Florian Westphal
2026-10-30 15:12 ` Fernando Fernandez Mancera
2026-10-30 15:28 ` Florian Westphal
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=auSrTEnc8tibSGs2@strlen.de \
--to=fw@strlen.de \
--cc=coreteam@netfilter.org \
--cc=fmancera@suse.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
--cc=vega@nebusec.ai \
/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.