From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8862E430BA3; Sun, 1 Mar 2026 01:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772330062; cv=none; b=quVUdB1rjzqH1CPKxEHtHHnq5HH5x92qnH5yYauOGPeI1fQFRL8eg6KQLaXHLcpc7cl/i0vMhtCkWzuDjEMksJAbbRE6y2egOh+0l27r1FBV4EpJX1g10AwCdxYeE+d8jZZkwLDsDcd0eycxFhwfsrPzUjYqFzSsNpnxVp2n5JI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772330062; c=relaxed/simple; bh=P00VzaMUBMDnjsh85U0Jr3rE9YPzjS2K8q1ybbz0jyM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uQ6T3SS2ZTVSfBx6ZYZbAjPLRWqaXgMW2gWutVi66jtmGHPv54fX/Ydz/broctvYjzps9Cdk2DVayt0xbpRp8wHDmUhG4zjMzeBh3MhdT2JVfYd+RZzU4NxYZct6TWOLvdqdBw5HQQ25t6uj6UE0w3S1OFHeLtaRm6bkDSBlriI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YSO/b0VR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YSO/b0VR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57149C19421; Sun, 1 Mar 2026 01:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772330062; bh=P00VzaMUBMDnjsh85U0Jr3rE9YPzjS2K8q1ybbz0jyM=; h=From:To:Cc:Subject:Date:From; b=YSO/b0VR3WyIInHxvEdSO4dB09CuDueKpw94cluxFSUHL0QOFvnY2X+6etIT/3+MJ 0qCt4WXtBnia3tn42+QsfU4Vh/tYCYoQ3R4aInnIOtEnhMh+U55FpbaorzB/A1sTBJ lxsIH4oaf/TqrUyG/H8dXu4VwtHH1bvpwaDdl9phaKpSxqMuTRvX+9atcZGRYIbktz P9Qs15HVyytRh11l7NiQ9mkiXO64c3fZROxZoh0HJjBvapp3exmrJQq256fuwwzeCW aTMoNQN8Sg0i4IKNarbmYh7i/E09iyD6JLmS0K4ea995BKgVTEen0pJWKIN8BIsxwk gexQ1DDBftPkQ== From: Sasha Levin To: stable@vger.kernel.org, metze@samba.org Cc: Namjae Jeon , Steve French , Tom Talpey , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, Steve French Subject: FAILED: Patch "smb: server: let send_done handle a completion without IB_SEND_SIGNALED" failed to apply to 5.15-stable tree Date: Sat, 28 Feb 2026 20:54:19 -0500 Message-ID: <20260301015420.1721305-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-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 . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 9da82dc73cb03e85d716a2609364572367a5ff47 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 22 Jan 2026 18:16:47 +0100 Subject: [PATCH] smb: server: 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. Cc: # 6.18.x Cc: Namjae Jeon Cc: Steve French Cc: Tom Talpey Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher Acked-by: Namjae Jeon Signed-off-by: Steve French --- fs/smb/server/transport_rdma.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index 5c0cc5064e8c0..c94068b78a1d2 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -1059,6 +1059,31 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc) ib_wc_status_msg(wc->status), wc->status, wc->opcode); + if (unlikely(!(sendmsg->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... + */ + pr_err("unexpected send completion wc->status=%s (%d) wc->opcode=%d\n", + ib_wc_status_msg(wc->status), wc->status, wc->opcode); + smb_direct_disconnect_rdma_connection(sc); + return; + } + /* * Free possible siblings and then the main send_io */ @@ -1072,6 +1097,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: pr_err("Send error. status='%s (%d)', opcode=%d\n", ib_wc_status_msg(wc->status), wc->status, wc->opcode); -- 2.51.0