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 89588C8E6; Mon, 22 Sep 2025 19:33:21 +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=1758569601; cv=none; b=HxSVkEFzDz/1gh00rhEHCAkjKN08q7f26j5+eC4qLS4f0lZplgogpq1uEn920iOm/H53dekoTapKFrbOqVVC1yeROhOfIiBw3d15Ce0CJvR6i7DM4SjZRh4/LeDRB1h93EhoBzqrejP6WR77x6veN/IoTJBZJK9EBjV72lcH2OI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758569601; c=relaxed/simple; bh=BLVtAvvOI9l9nyKOakCo6O3gEHUseulk5jE5cAtPVRM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f6w0DjA2Pp6haAYwRg6OwY8aBDhGlmlTEV2ecZHEPiCbiqpB6tct57h7C5nUGcb+SDzvcStpbh8XoEup8BL4DJeZ8zbwMAojnaZ3A1eEP0h0YT6yXc7i/RcGyzoeG0f4XWHXpqod2Xf6PXOh62GQXYrzS5CHYQsN9oXqediI8JA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KpwEf1nm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KpwEf1nm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21B05C4CEF0; Mon, 22 Sep 2025 19:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758569601; bh=BLVtAvvOI9l9nyKOakCo6O3gEHUseulk5jE5cAtPVRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KpwEf1nmHDK1pb2FJk40NxIBkHjODdb/4xfInxJtSLpEsi7j3QkfPdpfbuxzTXC4P KzU7LtkTES4gA7w7tzaQTCdTWyd7BnKFXSFO+al1pcpGnM1UPKZ7Hv5BEZyWClzQb8 Rog6aqIsSnYhwOGSJebxi1pizcN694Jwy1DUyIqo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Steve French , Tom Talpey , Long Li , Namjae Jeon , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, Stefan Metzmacher , Steve French , Sasha Levin Subject: [PATCH 6.1 45/61] smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path Date: Mon, 22 Sep 2025 21:29:38 +0200 Message-ID: <20250922192404.830838087@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250922192403.524848428@linuxfoundation.org> References: <20250922192403.524848428@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Metzmacher [ Upstream commit daac51c7032036a0ca5f1aa419ad1b0471d1c6e0 ] During tests of another unrelated patch I was able to trigger this error: Objects remaining on __kmem_cache_shutdown() Cc: Steve French Cc: Tom Talpey Cc: Long Li Cc: Namjae Jeon Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Fixes: f198186aa9bb ("CIFS: SMBD: Establish SMB Direct connection") Signed-off-by: Stefan Metzmacher Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/smb/client/smbdirect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index d47eae133a202..b648bb30401d5 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -1084,8 +1084,10 @@ static int smbd_negotiate(struct smbd_connection *info) log_rdma_event(INFO, "smbd_post_recv rc=%d iov.addr=0x%llx iov.length=%u iov.lkey=0x%x\n", rc, response->sge.addr, response->sge.length, response->sge.lkey); - if (rc) + if (rc) { + put_receive_buffer(info, response); return rc; + } init_completion(&info->negotiate_completion); info->negotiate_done = false; -- 2.51.0