FAILED: Patch "smb: client: let send_done handle a completion without IB_SEND_SIGNALED" failed to apply to 6.12-stable tree
Subsystems (4)
Sasha Levin
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From cf74fcdc43b322b6188a0750b5ee79e38be6d078 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <[email protected]>
Date: Thu, 22 Jan 2026 18:17:00 +0100
Subject: [PATCH] smb: client: let send_done handle a completion without
IB_SEND_SIGNALED
With smbdirect_send_batch processing we likely have requests without IB_SEND_SIGNALED, which will be destroyed in the final request that has IB_SEND_SIGNALED set.
If the connection is broken all requests are signaled even without explicit IB_SEND_SIGNALED.
--- fs/smb/client/smbdirect.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
fs/smb/client/smbdirect.c +27 -0
@@ -554,6 +554,32 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)log_rdma_send (INFO ,"smbdirect_send_io 0x%p completed wc->status=%s\n" , request,ib_wc_status_msg (wc->status)); +if (unlikely (!(request->wr.send_flags &IB_SEND_SIGNALED ))) { +/* +* This happens when smbdirect_send_io is a sibling +* before the final message, it is signaled on +* error anyway, so we need to skip +* smbdirect_connection_free_send_io here, +* otherwise is will destroy the memory +* of the siblings too, which will cause +* use after free problems for the others +* triggered from ib_drain_qp(). +*/ +if (wc->status !=IB_WC_SUCCESS ) + goto skip_free; + +/* +* This should not happen! +* But we better just close the +* connection... +*/ +log_rdma_send (ERR , +"unexpected send completion wc->status=%s (%d) wc->opcode=%d\n" , +ib_wc_status_msg (wc->status), wc->status, wc->opcode); +smbd_disconnect_rdma_connection (sc); +return ; + } +/* * Free possible siblings and then the main send_io */
@@ -567,6 +593,7 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc) lcredits +=1 ;if (wc->status !=IB_WC_SUCCESS || wc->opcode !=IB_WC_SEND ) { +skip_free:if (wc->status !=IB_WC_WR_FLUSH_ERR )log_rdma_send (ERR ,"wc->status=%s wc->opcode=%d\n" ,ib_wc_status_msg (wc->status), wc->opcode);
Signature · 1 line
2.51.0