From: Jiri Pirko <jiri@resnulli.us>
To: sashiko-reviews@lists.linux.dev
Cc: mkoutny@suse.com, Vasily Gorbik <gor@linux.ibm.com>,
hannes@cmpxchg.org, tj@kernel.org, linux-s390@vger.kernel.org,
Heiko Carstens <hca@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH rdma-next 03/13] RDMA/core: Support renaming a device when changing its net namespace
Date: Mon, 13 Jul 2026 14:17:18 +0200 [thread overview]
Message-ID: <alTXKYuAhGdT_oG_@FV6GYCPJ69> (raw)
In-Reply-To: <20260710095626.D434B1F000E9@smtp.kernel.org>
Fri, Jul 10, 2026 at 11:56:26AM +0200, sashiko-bot@kernel.org wrote:
>Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>- [Medium] The destination device name requested by userspace is ignored during a net namespace move because NULL is hardcoded in the netlink handler.
>--
>
>--- Patch [3]: [PATCH rdma-next 03/13] RDMA/core: Support renaming a device when changing its net namespace ---
>commit 481a893ec5cd10a7f8be8c8de249d86cc283c470
>Author: Jiri Pirko <jiri@nvidia.com>
>
>RDMA/core: Support renaming a device when changing its net namespace
>
>This patch updates the RDMA core to allow requesting a destination device
>name when moving a device to a different network namespace. It modifies
>ib_device_set_netns_put to take a requested name and implements the naming
>rules during namespace teardown.
>
>> diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
>> index 3a9ec43a16f1a..3540cb0b9d4fb 100644
>> --- a/drivers/infiniband/core/nldev.c
>> +++ b/drivers/infiniband/core/nldev.c
>> @@ -1194,7 +1194,7 @@ static int nldev_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
>> u32 ns_fd;
>>
>> ns_fd = nla_get_u32(tb[RDMA_NLDEV_NET_NS_FD]);
>> - err = ib_device_set_netns_put(skb, device, ns_fd);
>> + err = ib_device_set_netns_put(skb, device, ns_fd, NULL);
>
>[Severity: Medium]
>Does this hardcode NULL instead of extracting and passing the user-provided
>device name?
>
>The commit message mentions allowing namespace moves to request a destination
>device name, but it appears ib_device_set_netns_put is always called with
>NULL here.
>
>How does this interact with the rename logic in nldev_set_doit? If a user
>supplies both the RDMA_NLDEV_ATTR_DEV_NAME and RDMA_NLDEV_NET_NS_FD
>attributes in the netlink command, will the code enter the rename logic first
>and return, completely skipping the net namespace change instead of moving and
>renaming the device?
False positive. "RDMA/nldev: Allow setting the device name while changing
net namespace" is doing this.
>
>> if (err == -EEXIST)
>> NL_SET_ERR_MSG(extack,
>> "Device name already exists in the target net namespace");
>
>--
>Sashiko AI review · https://sashiko.dev/#/patchset/20260709095532.855647-1-jiri@resnulli.us?part=3
next prev parent reply other threads:[~2026-07-13 12:17 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 9:55 [PATCH rdma-next 00/13] RDMA: Make device names unique per net namespace Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 01/13] RDMA/core: Pass the net namespace to the device name lookups Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 02/13] RDMA/core: Handle device name conflicts when changing net namespace Jiri Pirko
2026-07-10 9:56 ` sashiko-bot
2026-07-13 12:32 ` Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 03/13] RDMA/core: Support renaming a device when changing its " Jiri Pirko
2026-07-10 9:56 ` sashiko-bot
2026-07-13 12:17 ` Jiri Pirko [this message]
2026-07-09 9:55 ` [PATCH rdma-next 04/13] RDMA/nldev: Report net namespace move errors through extack Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 05/13] RDMA/nldev: Allow setting the device name while changing net namespace Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 06/13] net/smc: Look up the pnetid ib device within the " Jiri Pirko
2026-07-10 9:56 ` sashiko-bot
2026-07-09 9:55 ` [PATCH rdma-next 07/13] RDMA/srp: Make the SRP sysfs class net namespace aware Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 08/13] RDMA/cgroup: Scope rdma cgroup device visibility to the net namespace Jiri Pirko
2026-07-09 13:04 ` Michal Koutný
2026-07-13 9:34 ` Jiri Pirko
2026-07-10 9:56 ` sashiko-bot
2026-07-09 9:55 ` [PATCH rdma-next 09/13] RDMA/cma: Document that CM configfs cannot be net namespace scoped Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 10/13] RDMA/core: Document the SELinux ibendport net namespace limitation Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 11/13] RDMA/core: Make device names unique per net namespace Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 12/13] RDMA/rxe: Implement disassociate_ucontext callback Jiri Pirko
2026-07-10 4:21 ` Zhu Yanjun
2026-07-10 9:56 ` sashiko-bot
2026-07-13 13:24 ` Jiri Pirko
2026-07-09 9:55 ` [PATCH rdma-next 13/13] RDMA/selftests: Add rxe_netns_names test Jiri Pirko
2026-07-10 4:24 ` Zhu Yanjun
2026-07-13 8:58 ` Jiri Pirko
2026-07-10 9:56 ` sashiko-bot
2026-07-13 13:35 ` Jiri Pirko
2026-07-10 23:51 ` yanjun.zhu
2026-07-13 9:02 ` Jiri Pirko
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=alTXKYuAhGdT_oG_@FV6GYCPJ69 \
--to=jiri@resnulli.us \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hannes@cmpxchg.org \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tj@kernel.org \
/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