Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Andrew Stellman <astellman@stellman-greene.com>
Cc: Zhu Yanjun <zyjzyj2000@gmail.com>, Jason Gunthorpe <jgg@ziepe.ca>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/rxe: Require a responder resource for FLUSH
Date: Sun, 22 Nov 2026 17:11:03 +0200	[thread overview]
Message-ID: <20261122151103.GG14811@unreal> (raw)
In-Reply-To: <20261119151332.95466-1-astellman@stellman-greene.com>

On Thu, Nov 19, 2026 at 10:13:32AM -0500, Andrew Stellman wrote:
> process_flush() keeps its state in a responder resource from
> rxe_prepare_res(), as READ and ATOMIC requests do. check_resource()
> refuses those requests when max_dest_rd_atomic is 0, but it does not
> check FLUSH. With max_dest_rd_atomic 0, qp->resp.resources is
> ZERO_SIZE_PTR, and rxe_prepare_res() writes through it in
> free_rd_atomic_resource().
> 
> A FLUSH sent to an RC QP with max_dest_rd_atomic 0 oopses the
> responder:
> 
>   KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
>   Workqueue: rxe_wq do_work
>   RIP: 0010:free_rd_atomic_resource+0x15/0x50
>   Call Trace:
>    rxe_receiver+0x5f6e/0x9a20
>    do_work+0x144/0x470
> 
> The responder task dies, and destroying the QP later warns on a timeout
> in __rxe_cleanup() and then hangs.

Please resend this patch with untrimmed dmesg stack trace.

Thanks

> 
> Add RXE_FLUSH_MASK to the check, so a FLUSH gets the same Invalid
> Request NAK a READ would, and the requester sees IB_WC_REM_INV_REQ_ERR.
> 
> The issue was found by Claude Opus 5.5 running Quality Playbook, an
> LLM-driven code review tool:
> https://github.com/andrewstellman/quality-playbook
> The fix and this changelog were drafted with the same tool and reviewed
> by me.
> 
> Fixes: ea1bb00ee9a5 ("RDMA/rxe: Implement flush execution in responder side")
> Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
> ---
> 
> Tested in QEMU with KASAN on v7.4-rc3, and on v7.4-rc3 with the RDMA
> code from rdma for-next (7404c82cbf12). The reproducer is a short
> libibverbs program; I can send it off-list.
> 
>  drivers/infiniband/sw/rxe/rxe_resp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
> index 1b7f31737225..38b5b0c2abe3 100644
> --- a/drivers/infiniband/sw/rxe/rxe_resp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_resp.c
> @@ -340,7 +340,8 @@ static enum resp_states check_resource(struct rxe_qp *qp,
>  {
>  	struct rxe_srq *srq = qp->srq;
>  
> -	if (pkt->mask & (RXE_READ_OR_ATOMIC_MASK | RXE_ATOMIC_WRITE_MASK)) {
> +	if (pkt->mask & (RXE_READ_OR_ATOMIC_MASK | RXE_ATOMIC_WRITE_MASK |
> +			 RXE_FLUSH_MASK)) {
>  		/* it is the requesters job to not send
>  		 * too many read/atomic ops, we just
>  		 * recycle the responder resource queue
> 
> base-commit: 7404c82cbf1246e0e84e2ec21834d23c26f9a8ed
> -- 
> 2.43.0
> 
> 

      parent reply	other threads:[~2026-11-22 15:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 15:13 [PATCH rdma-next] RDMA/rxe: Require a responder resource for FLUSH Andrew Stellman
2026-11-19 15:23 ` sashiko-bot
2026-11-22 15:11 ` Leon Romanovsky [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=20261122151103.GG14811@unreal \
    --to=leon@kernel.org \
    --cc=astellman@stellman-greene.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox