mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Maoyi Xie <maoyixie.tju@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	James Chapman <jchapman@katalix.com>,
	Tom Parkin <tparkin@katalix.com>,
	Guillaume Nault <gnault@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH net] l2tp: send netlink notifications in the tunnel's net namespace
Date: Tue, 11 Aug 2026 10:02:54 +0100	[thread overview]
Message-ID: <20260811090254.GZ51943@horms.kernel.org> (raw)
In-Reply-To: <20260809094252.2107242-1-maoyixie.tju@gmail.com>

On Sun, Aug 09, 2026 at 05:42:52PM +0800, Maoyi Xie wrote:
> l2tp_tunnel_notify() and l2tp_session_notify() use
> genlmsg_multicast_allns(), which delivers to listeners in every network
> namespace. l2tp is per-namespace, and a tunnel records the namespace it
> belongs to in tunnel->l2tp_net. Each event concerns one namespace, yet
> every namespace is told about it. A tunnel event carries the tunnel and
> peer tunnel ids, plus the socket's addresses with both ports for a UDP
> tunnel. A session event carries the session and peer session ids, the
> interface name, plus the L2TP cookies where those are set. A listener
> needs no privilege for any of this, because l2tp_multicast_group[]
> carries no flags and genl_bind() asks for no capability.
> 
> The fix is to send to the tunnel's namespace with
> genlmsg_multicast_netns(). Commit 134e63756d5f ("genetlink: make netns
> aware") added both helpers and drew the line between them. The netns
> variant is for an object that lives in a namespace.
> 
> I found this by auditing the tree's six genlmsg_multicast_allns() call
> sites for objects that live in a network namespace. Only the two l2tp
> ones do.
> 
> I reproduced it on net at dd057113ac7b, in a virtual machine, with no
> real hardware involved. A process in the initial namespace, running as
> an ordinary user with an empty capability set, receives the create and
> delete events of a tunnel. The tunnel was set up inside an unprivileged
> user and network namespace. tools/testing/selftests/net/l2tp.sh passes
> before and after.
> 
> On a container host, any local user and every other tenant can read a
> tenant's tunnel parameters.
> 
> Fixes: 33f72e6f0c67 ("l2tp : multicast notification to the registered listeners")
> Cc: stable@vger.kernel.org
> Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>

FTR, I don't think the issues flagged by Sashiko [1] should
block progress of this patch. But you may want to look into
them in the context of possible follow-up.

[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260809094252.2107242-1-maoyixie.tju%40gmail.com

  reply	other threads:[~2026-08-11  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09  9:42 Maoyi Xie
2026-08-11  9:02 ` Simon Horman [this message]
2026-08-14  3:24 ` 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=20260811090254.GZ51943@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gnault@redhat.com \
    --cc=jchapman@katalix.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maoyixie.tju@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tparkin@katalix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®