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 93D1A221FBB; Sun, 1 Mar 2026 02:03:59 +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=1772330639; cv=none; b=Esc12xjPzzmE66m/zKaIlQvw1GMD+n5Nb0lOhZd09aLN7c70fvcwkaEmaavR1IArMGq72+Z1FM4wefLPJr5PWiEusIGS199RON7a/zow9r590CSj8TiM7U7howy3CdJfkYBOWZxCP9j/xfgirrDinbMxzu7cLqNWY88JM6CAs2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772330639; c=relaxed/simple; bh=2ZN7E7oyQYsjiVupKzioPASmU+EOGLSn5E+bWS0UP+s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LWzsKtFgFFwpFT1yaIXH7xHaMAOrqQycAdWrKVPDh59H98/Rxk88gbSlPgb4vMt+f8lLFnFpvP8n8oTadkZ2dmcs6mYjrIT84nOJOio72F+OtQQG2utDr3oABE1QhC997Iyh48EL2zH/He+X2qfXDaFFSYDMyeyNhdlu9O9C/MQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lfw6Wt3g; 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="lfw6Wt3g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2488C19421; Sun, 1 Mar 2026 02:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772330639; bh=2ZN7E7oyQYsjiVupKzioPASmU+EOGLSn5E+bWS0UP+s=; h=From:To:Cc:Subject:Date:From; b=lfw6Wt3gYOmxPt7i2T1/YNbicy+VcPTZql3Ps1ZBF8tA3xDVnMgdaL2oQpRgsNntv JU/sd6/QXNZkmejUFeKGl0TeTZM93rohHs2zg2YJAi4kzp9QUNzoajIvmODh89i+pH BNFPFCcciSLOa5SX1LxUjrEGsrIEe1fW/HKudeyHRrX4QFSTkfYQvvDVmlPGeMIgB9 vypMSC6xtC/EtX1WX3rkHdFT/rORHba4KXjQtVHT33m1jFq/oB1Xsn1R6NiXQnoXVz F5FV7mErKIU9Ve6NJNXvs3fmNeufbprwgDlcKeishN0vkQeSlmNViqwjWuFYDJSd0/ CNrUBsXSobi+A== 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.10-stable tree Date: Sat, 28 Feb 2026 21:03:57 -0500 Message-ID: <20260301020357.1732133-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@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.10-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