From: sashiko-bot@kernel.org
To: "Eric Davis" <eric.davis@broadcom.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next 05/13] RDMA/core: extended address handle attributes
Date: Wed, 14 Oct 2026 22:50:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-172008@kernel.org> (raw)
In-Reply-To: <20261014-uet-ib-core-v1-5-a0e626117113@broadcom.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] rdma: uverbs_copy_from() breaks forward ABI compat for zero-padded structs
--
commit 580d7ef2fa7c4af573e68362c952e7b8886ec21b
Author: Eric Davis <eric.davis@broadcom.com>
RDMA/core: extended address handle attributes
This commit adds rdma_ah_attr_ex to carry new attributes and implements
an ioctl method to support extended address handles. It also updates
rdma_create_user_ah() to accept the initialized attributes.
> diff --git a/drivers/infiniband/core/uverbs_std_types.c b/drivers/infiniband/core/uverbs_std_types.c
> index e160786e1df16..c72c9e5a22863 100644
> --- a/drivers/infiniband/core/uverbs_std_types.c
> +++ b/drivers/infiniband/core/uverbs_std_types.c
> @@ -184,6 +184,76 @@ DECLARE_UVERBS_NAMED_OBJECT(UVERBS_OBJECT_MW,
[ ... ]
> +static int UVERBS_HANDLER(UVERBS_METHOD_AH_EX_CREATE)(
> + struct uverbs_attr_bundle *attrs)
> +{
[ ... ]
> + if (!(ib_dev->attrs.device_cap_flags & IB_DEVICE_RU))
> + return -EOPNOTSUPP;
> +
> + ret = uverbs_copy_from(&uah, attrs,
> + UVERBS_ATTR_CREATE_AH_EX_AH_ATTR_EX);
[Severity: Medium]
Does using uverbs_copy_from() here break forward ABI compatibility?
UVERBS_ATTR_STRUCT sets .zero_trailing = 1, which should permit a newer
userspace to pass a larger zero-padded payload to an older kernel. However,
_uverbs_copy_from() explicitly rejects larger sizes:
include/rdma/uverbs_ioctl.h:_uverbs_copy_from() {
...
if (unlikely(size < attr->ptr_attr.len))
return -EINVAL;
...
}
If a newer userspace application passes a zero-padded payload of 40 bytes to
this kernel (where the structure size is 36), the size check in
_uverbs_copy_from() will evaluate to 36 < 40 and return -EINVAL.
Should this use uverbs_copy_from_or_zero() instead, to properly support
trailing zeros and allow future structure extensions?
> + if (ret)
> + return ret;
> +
> + ret = copy_ah_attr_from_uverbs_ah(ib_dev, &attr.ah_attr, &uah.ah_attr);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261014-uet-ib-core-v1-0-a0e626117113@broadcom.com?part=5
next prev parent reply other threads:[~2026-10-14 22:50 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 22:21 [PATCH rdma-next 00/13] RDMA/core: Ultra Ethernet transport verbs Eric Davis via B4 Relay
2026-10-14 22:21 ` [PATCH rdma-next 01/13] RDMA/core: widen the uverbs object key Eric Davis via B4 Relay
2026-10-14 22:29 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 02/13] RDMA/core: add the UET GID types Eric Davis via B4 Relay
2026-10-14 22:35 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 03/13] RDMA/core: report the reliable unconnected device capabilities Eric Davis via B4 Relay
2026-10-14 22:30 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 04/13] RDMA/core: add the reliable unconnected queue pair type Eric Davis via B4 Relay
2026-10-14 22:43 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 05/13] RDMA/core: extended address handle attributes Eric Davis via B4 Relay
2026-10-14 22:50 ` sashiko-bot [this message]
2026-10-14 22:21 ` [PATCH rdma-next 06/13] RDMA/core: query the semantics a queue pair type guarantees Eric Davis via B4 Relay
2026-10-14 22:34 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 07/13] RDMA/core: job and job key objects Eric Davis via B4 Relay
2026-10-14 22:36 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 08/13] RDMA/uverbs: factor out the queue pair attribute copy Eric Davis via B4 Relay
2026-10-14 22:30 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 09/13] RDMA/core: create a queue pair ready to send Eric Davis via B4 Relay
2026-10-14 22:39 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 10/13] RDMA/core: queue pair attributes for unconnected transports Eric Davis via B4 Relay
2026-10-14 22:41 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 11/13] RDMA/core: extended memory registration Eric Davis via B4 Relay
2026-10-14 22:36 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 12/13] RDMA/core: 64-bit memory keys Eric Davis via B4 Relay
2026-10-14 22:32 ` sashiko-bot
2026-10-14 22:21 ` [PATCH rdma-next 13/13] RDMA/core: attach a memory region to a queue pair Eric Davis via B4 Relay
2026-10-14 22:37 ` sashiko-bot
2026-10-14 23:57 ` [PATCH rdma-next 00/13] RDMA/core: Ultra Ethernet transport verbs Doug Ledford
2026-10-15 0:08 ` Jason Gunthorpe
2026-10-15 1:02 ` Doug Ledford
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=sashiko-outbox-172008@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=eric.davis@broadcom.com \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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