From: sashiko-bot@kernel.org
To: "Eric Davis" <eric.davis@broadcom.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next v3 10/13] RDMA/core: queue pair attributes for unconnected transports
Date: Tue, 10 Nov 2026 05:29:26 +0000 [thread overview]
Message-ID: <sashiko-outbox-206295@kernel.org> (raw)
In-Reply-To: <20261109-uet-ib-core-v3-10-3e7e7ffed2e9@broadcom.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] RDMA/core: incomplete zero-size ordering check in
create_qp_opt_attrs()
--
commit ab78e9acb0c6a04e98901cf4dece43df9ce37611
Author: Eric Davis <eric.davis@broadcom.com>
RDMA/core: queue pair attributes for unconnected transports
This commit adds creation attributes for reliable unconnected (IB_QPT_RU)
queue pairs, including initiator source ID, job key binding, and ordering
semantics validation.
> diff --git a/drivers/infiniband/core/uverbs_std_types_qp.c b/drivers/infiniband/core/uverbs_std_types_qp.c
> index 249206d2992f9..a1112083fb73f 100644
> --- a/drivers/infiniband/core/uverbs_std_types_qp.c
> +++ b/drivers/infiniband/core/uverbs_std_types_qp.c
[ ... ]
> + if (has_semantics) {
> + ret = uverbs_copy_from_or_zero(&usem, attrs,
> + UVERBS_ATTR_CREATE_QP_SEMANTICS);
> + if (ret)
> + return ret;
> +
> + m = usem.comp_mask;
> + if ((m & ~QP_SEMANTICS_MASK_ALL) ||
> + ((m & IB_UVERBS_QP_SEMANTICS_MASK_MSG_ORDER) &&
> + (usem.msg_order & ~QP_ORDER_ALL)) ||
> + ((m & IB_UVERBS_QP_SEMANTICS_MASK_USAGE) &&
> + (usem.usage_flags & ~QP_USAGE_ALL)) ||
> + memchr_inv(usem.reserved, 0, sizeof(usem.reserved)))
> + return -EINVAL;
> +
> + /* only the fields comp_mask selects reach the driver */
> + sem->comp_mask = m;
> + if (m & IB_UVERBS_QP_SEMANTICS_MASK_MSG_ORDER)
> + sem->msg_order = usem.msg_order;
> + if (m & IB_UVERBS_QP_SEMANTICS_MASK_RAW)
> + sem->max_rdma_raw_size = usem.max_rdma_raw_size;
> + if (m & IB_UVERBS_QP_SEMANTICS_MASK_WAR)
> + sem->max_rdma_war_size = usem.max_rdma_war_size;
> + if (m & IB_UVERBS_QP_SEMANTICS_MASK_WAW)
> + sem->max_rdma_waw_size = usem.max_rdma_waw_size;
> + if (m & IB_UVERBS_QP_SEMANTICS_MASK_PDU)
> + sem->max_pdu = usem.max_pdu;
> + if (m & IB_UVERBS_QP_SEMANTICS_MASK_USAGE)
> + sem->usage_flags = usem.usage_flags;
> + if (m & IB_UVERBS_QP_SEMANTICS_MASK_IMM)
> + sem->imm_data_size = usem.imm_data_size;
> +
> + /* nor an ordering whose data-ordering size it gives as 0 */
> + if (((m & IB_UVERBS_QP_SEMANTICS_MASK_RAW) &&
> + !sem->max_rdma_raw_size &&
> + (sem->msg_order & QP_ORDER_RAW_SIZED)) ||
> + ((m & IB_UVERBS_QP_SEMANTICS_MASK_WAR) &&
> + !sem->max_rdma_war_size &&
> + (sem->msg_order & QP_ORDER_WAR_SIZED)) ||
> + ((m & IB_UVERBS_QP_SEMANTICS_MASK_WAW) &&
> + !sem->max_rdma_waw_size &&
> + (sem->msg_order & QP_ORDER_WAW_SIZED)))
> + return -EINVAL;
[Severity: Medium]
Can userspace bypass this zero-size ordering check by omitting
IB_UVERBS_QP_SEMANTICS_MASK_MSG_ORDER from comp_mask?
sem->msg_order is only populated when IB_UVERBS_QP_SEMANTICS_MASK_MSG_ORDER
is set in m, remaining 0 otherwise. If a caller sets
IB_UVERBS_QP_SEMANTICS_MASK_RAW with max_rdma_raw_size == 0 and leaves
IB_UVERBS_QP_SEMANTICS_MASK_MSG_ORDER clear, sem->msg_order is 0 and this
check passes even though the caller did not relax msg_order and the device
default adv.msg_order still has QP_ORDER_RAW_SIZED set, passing inconsistent
semantics in attr->qp_semantics to the driver. Should this check test
against the effective msg_order (using adv.msg_order when
IB_UVERBS_QP_SEMANTICS_MASK_MSG_ORDER is not set, and conversely checking
adv.max_rdma_*_size when a sized ordering bit is requested without its size
mask)?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-uet-ib-core-v3-0-3e7e7ffed2e9@broadcom.com?part=10
next prev parent reply other threads:[~2026-11-10 5:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 4:00 [PATCH rdma-next v3 00/13] RDMA/core: Ultra Ethernet transport verbs Eric Davis via B4 Relay
2026-11-10 4:00 ` [PATCH rdma-next v3 01/13] RDMA/core: widen the uverbs object key Eric Davis via B4 Relay
2026-11-10 4:10 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 02/13] RDMA/core: add the UET GID types Eric Davis via B4 Relay
2026-11-10 4:21 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 03/13] RDMA/core: report the reliable unconnected device capabilities Eric Davis via B4 Relay
2026-11-10 4:25 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 04/13] RDMA/core: add the reliable unconnected queue pair type Eric Davis via B4 Relay
2026-11-10 4:36 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 05/13] RDMA/core: extended address handle attributes Eric Davis via B4 Relay
2026-11-10 4:45 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 06/13] RDMA/core: query the semantics a queue pair type guarantees Eric Davis via B4 Relay
2026-11-10 4:49 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 07/13] RDMA/core: job and job key objects Eric Davis via B4 Relay
2026-11-10 4:59 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 08/13] RDMA/uverbs: factor out the queue pair attribute copy Eric Davis via B4 Relay
2026-11-10 5:04 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 09/13] RDMA/core: create a queue pair ready to send Eric Davis via B4 Relay
2026-11-10 5:14 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 10/13] RDMA/core: queue pair attributes for unconnected transports Eric Davis via B4 Relay
2026-11-10 5:29 ` sashiko-bot [this message]
2026-11-11 16:45 ` Eric Davis
2026-11-10 4:00 ` [PATCH rdma-next v3 11/13] RDMA/core: extended memory registration Eric Davis via B4 Relay
2026-11-10 5:55 ` sashiko-bot
2026-11-11 16:46 ` Eric Davis
2026-11-10 4:00 ` [PATCH rdma-next v3 12/13] RDMA/core: 64-bit memory keys Eric Davis via B4 Relay
2026-11-10 6:01 ` sashiko-bot
2026-11-10 4:00 ` [PATCH rdma-next v3 13/13] RDMA/core: attach a memory region to a queue pair Eric Davis via B4 Relay
2026-11-10 6:20 ` sashiko-bot
2026-11-11 16:49 ` Eric Davis
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-206295@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