All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tristan Madani" <tristmd@gmail.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH v9 2/2] RDMA/rxe: copy send WQE to kernel buffer in completer path
Date: Fri, 30 Oct 2026 18:56:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-191426@kernel.org> (raw)
In-Reply-To: <20261030183409.195671-3-tristan@talencesecurity.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] RDMA/rxe: comp_wqe_valid cleared in rxe_requester() before struct definition
--

commit fe57a6fbeb3985861e302c45b7aad80d47e4ce81
Author: Tristan Madani <tristmd@gmail.com>

RDMA/rxe: copy send WQE to kernel buffer in completer path

This commit copies the send WQE from the userspace-mapped shared queue into a
completer-private buffer in get_wqe() to prevent TOCTOU races, validates the
opcode and SGE bounds, and writes back DMA progress and completion status to
shared memory.

[ ... ]

> diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h
> index 0fc6c69f4f840..ddc195c283326 100644
> --- a/drivers/infiniband/sw/rxe/rxe_verbs.h
> +++ b/drivers/infiniband/sw/rxe/rxe_verbs.h
> @@ -130,6 +130,12 @@ struct rxe_comp_info {
>  	int			started_retry;
>  	u32			retry_cnt;
>  	u32			rnr_retry;
> +	struct rxe_send_wqe	*shared_wqe;
> +	bool			comp_wqe_valid;
> +	struct {
> +		struct rxe_send_wqe	wqe;
> +		struct ib_sge		sge[RXE_MAX_SGE];
> +	} comp_wqe;
>  };

[Severity: Low]
Does the previous patch in the series ("RDMA/rxe: copy send WQE to kernel
buffer before processing") fail to build on its own because it references
qp->comp.comp_wqe_valid before comp_wqe_valid is added to struct rxe_comp_info
here?

In that first patch, rxe_requester() in drivers/infiniband/sw/rxe/rxe_req.c
adds:

	if (unlikely(qp->req.need_retry && !qp->req.wait_for_rnr_timer)) {
		req_retry(qp);
		qp->req.need_retry = 0;
		qp->req.send_wqe_valid = false;
		qp->comp.comp_wqe_valid = false;
	}

Should the qp->comp.comp_wqe_valid = false assignment in rxe_requester() be
moved into this commit so that each patch in the series compiles cleanly
during a git bisect?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261030183409.195671-1-tristan@talencesecurity.com?part=2

      reply	other threads:[~2026-10-30 18:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 18:34 [PATCH v9 0/2] RDMA/rxe: copy send WQE to kernel buffer (TOCTOU hardening) Tristan Madani
2026-10-30 18:34 ` [PATCH v9 1/2] RDMA/rxe: copy send WQE to kernel buffer before processing Tristan Madani
2026-10-30 18:51   ` sashiko-bot
2026-10-30 18:34 ` [PATCH v9 2/2] RDMA/rxe: copy send WQE to kernel buffer in completer path Tristan Madani
2026-10-30 18:56   ` sashiko-bot [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=sashiko-outbox-191426@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tristmd@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.