The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 5.15.y] smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path
@ 2026-06-03  8:15 Robert Garcia
  2026-06-04  0:05 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Garcia @ 2026-06-03  8:15 UTC (permalink / raw)
  To: stable, Stefan Metzmacher
  Cc: Steve French, Tom Talpey, Long Li, Namjae Jeon, Pavel Shilovsky,
	Robert Garcia, linux-cifs, samba-technical, linux-kernel

From: Stefan Metzmacher <metze@samba.org>

[ 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 <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
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 <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Robert Garcia <rob_garcia@163.com>
---
 fs/cifs/smbdirect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index 48bd879349fb..c9bda34fd2f5 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/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=%llx iov.length=%x iov.lkey=%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.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 5.15.y] smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path
  2026-06-03  8:15 [PATCH 5.15.y] smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path Robert Garcia
@ 2026-06-04  0:05 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2026-06-04  0:05 UTC (permalink / raw)
  To: stable, Stefan Metzmacher
  Cc: Sasha Levin, Steve French, Tom Talpey, Long Li, Namjae Jeon,
	Pavel Shilovsky, Robert Garcia, linux-cifs, samba-technical,
	linux-kernel

> [PATCH 5.15.y] smb: client: fix smbdirect_recv_io leak in
> smbd_negotiate() error path

Queued for 5.15.y, thanks. 5.10.y is affected as well, so I've also
queued the equivalent backport there.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-04  0:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03  8:15 [PATCH 5.15.y] smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path Robert Garcia
2026-06-04  0:05 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox