From: Jakub Kicinski <kuba@kernel.org>
To: achender@kernel.org
Cc: Jakub Kicinski <kuba@kernel.org>,
rds-devel@oss.oracle.com, edumazet@google.com,
linux-rdma@vger.kernel.org, horms@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org
Subject: Re: [PATCH net v1 2/2] net/rds: Restrict use of RDS/IB to the initial network namespace
Date: Mon, 6 Apr 2026 18:19:07 -0700 [thread overview]
Message-ID: <20260407011907.3596425-1-kuba@kernel.org> (raw)
In-Reply-To: <20260405041613.309958-3-achender@kernel.org>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net/rds: Restrict use of RDS/IB to the initial network namespace
Prevent using RDS/IB in network namespaces other than the initial one.
The existing RDS/IB code will not work properly in non-initial network
namespaces, and there are currently no plans to support such use.
Closes: https://syzkaller.appspot.com/bug?extid=da8e060735ae02c8f3d1
> diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
> --- a/net/rds/af_rds.c
> +++ b/net/rds/af_rds.c
[ ... ]
> @@ -373,6 +374,10 @@ static int rds_set_transport(struct net *net, struct rds_sock *rs,
> if (t_type < 0 || t_type >= RDS_TRANS_COUNT)
> return -EINVAL;
>
> + /* Only RDS/TCP supports non-initial network namespaces */
> + if (t_type != RDS_TRANS_TCP && !net_eq(net, &init_net))
> + return -EPROTOTYPE;
> +
[ ... ]
> diff --git a/net/rds/ib.c b/net/rds/ib.c
> --- a/net/rds/ib.c
> +++ b/net/rds/ib.c
> @@ -490,8 +490,13 @@
> static int rds_ib_laddr_check(struct net *net, const struct in6_addr *addr,
> __u32 scope_id)
> {
> - struct rds_ib_device *rds_ibdev = rds_ib_get_device(addr->s6_addr32[3]);
> + struct rds_ib_device *rds_ibdev;
>
> + /* RDS/IB is only supported in the initial network namespace */
> + if (!net_eq(net, &init_net))
> + return -EPROTOTYPE;
> +
^^^^
Is the wording "is only supported" in this comment precise? Looking at the
existing codebase, rds_ib_cm_handle_connect() already has a comment that
says "RDS/IB is not currently netns aware, thus init_net" with the phrase
"for now" in rds_ib_laddr_check_cm() suggesting this could change. Before
this patch, it was technically possible to attempt using RDS/IB in
non-init namespaces (though it led to the UAF bug). The comment might be
clearer if it said "RDS/IB does not work correctly in non-initial network
namespaces" or "RDS/IB is restricted to the initial network namespace" to
better distinguish between the technical limitation and the enforcement.
> + rds_ibdev = rds_ib_get_device(addr->s6_addr32[3]);
> if (rds_ibdev) {
> rds_ib_dev_put(rds_ibdev);
>
The commit message states "there are currently no plans to support such
use." While the existing code clearly does not support non-init namespaces
(with hardcoded &init_net references throughout), this statement about
future plans cannot be verified from code. The existing comments in
rds_ib_cm_handle_connect() and rds_ib_laddr_check_cm() use phrases like
"for now" and "not currently" which could suggest plans might exist or
could be placeholders. Is this policy statement necessary in the commit
message, or would it be sufficient to state the technical facts about the
current limitation?
prev parent reply other threads:[~2026-04-07 1:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-05 4:16 [PATCH net v1 0/2] net/rds: Fix use-after-free in RDS/IB for non-init namespaces Allison Henderson
2026-04-05 4:16 ` [PATCH net v1 1/2] net/rds: Optimize rds_ib_laddr_check Allison Henderson
2026-04-07 1:19 ` Jakub Kicinski
2026-04-07 1:19 ` Jakub Kicinski
2026-04-05 4:16 ` [PATCH net v1 2/2] net/rds: Restrict use of RDS/IB to the initial network namespace Allison Henderson
2026-04-07 1:19 ` Jakub Kicinski [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=20260407011907.3596425-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=achender@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rds-devel@oss.oracle.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