* [PATCH rdma-next] RDMA/rxe: Require a responder resource for FLUSH
@ 2026-11-19 15:13 Andrew Stellman
2026-11-19 15:23 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Stellman @ 2026-11-19 15:13 UTC (permalink / raw)
To: Zhu Yanjun; +Cc: Jason Gunthorpe, Leon Romanovsky, linux-rdma, linux-kernel
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.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH rdma-next] RDMA/rxe: Require a responder resource for FLUSH
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
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-19 15:23 UTC (permalink / raw)
To: Andrew Stellman; +Cc: linux-rdma
> 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
> [ ... ]
> 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>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119151332.95466-1-astellman@stellman-greene.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-19 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox