All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Zihan Xi <zihanx@nebusec.ai>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Patrick McHardy <kaber@trash.net>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Vega <vega@nebusec.ai>
Subject: Re: [PATCH net v4 1/1] ipmr: account multicast table and route memory
Date: Wed, 9 Sep 2026 10:10:00 +0300	[thread overview]
Message-ID: <20260909071000.GA1211770@shredder> (raw)
In-Reply-To: <050b58f7fc6b45da0fb12768ebb62d18fa46133d.1788784801.git.zihanx@nebusec.ai>

On Tue, Sep 08, 2026 at 11:58:39AM +0000, Zihan Xi wrote:
> A netadmin in a user+net namespace can create many IPv4 and IPv6
> multicast routing tables with MRT_TABLE and MRT6_TABLE. Each unseen
> id allocates an mr_table via the shared mr_table_alloc(), links it
> into the per-net list, and leaves it until netns teardown. Those
> objects were not charged to memcg, so the host unreclaimable slab
> grows with the table count.
> 
> Account mr_table allocations with GFP_KERNEL_ACCOUNT and mark the
> IPv4/IPv6 MFC caches SLAB_ACCOUNT. This matches the established
> handling of IP addresses, routes and alternate interface names.
> 
> Unresolved MFC entries are still allocated from softIRQ with
> GFP_ATOMIC and are not charged. They expire after 10 seconds and are
> bounded by the socket receive queue; see commit 0079ad8e8dc3
> ("ipmr: remove hard code cache_resolve_queue_len limit").

Not worth a v5, just noting in case Sashiko nit picks on it:

Unresolved MFC entries can be allocated from process context and in this
case they are charged correctly.

> 
> Fixes: f0ad0860d01e ("ipv4: ipmr: support multiple tables")
> Fixes: d1db275dd3f6 ("ipv6: ip6mr: support multiple tables")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Assisted-by: LLM
> Signed-off-by: Zihan Xi <zihanx@nebusec.ai>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

  reply	other threads:[~2026-09-09  7:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 11:58 [PATCH net v4 0/1] ipmr: unaccounted multicast table memory Zihan Xi
2026-09-08 11:58 ` [PATCH net v4 1/1] ipmr: account multicast table and route memory Zihan Xi
2026-09-09  7:10   ` Ido Schimmel [this message]
2026-09-09  7:30     ` zihan xi
2026-09-10 16:00 ` [PATCH net v4 0/1] ipmr: unaccounted multicast table memory patchwork-bot+netdevbpf

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=20260909071000.GA1211770@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kaber@trash.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=vega@nebusec.ai \
    --cc=zihanx@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.