Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Steve French <sfrench@samba.org>
Cc: dhowells@redhat.com, Shyam Prasad N <nspmangalore@gmail.com>,
	Rohith Surabattula <rohiths.msft@gmail.com>,
	Tom Talpey <tom@talpey.com>, Long Li <longli@microsoft.com>,
	Namjae Jeon <linkinjeon@kernel.org>,
	Stefan Metzmacher <metze@samba.org>,
	Jeff Layton <jlayton@kernel.org>,
	linux-cifs@vger.kernel.org
Subject: [PATCH] cifs: Fix oops due to uncleared server->smbd_conn in reconnect
Date: Wed, 25 Jan 2023 14:02:13 +0000	[thread overview]
Message-ID: <2132364.1674655333@warthog.procyon.org.uk> (raw)
In-Reply-To: <1130899.1674582538@warthog.procyon.org.uk>

Hi Steve,

That attached patch stops the kernel from oopsing, but it still tries
endlessly to send with softRoCE.  I'm having better luck with softIWarp - with
some other patches, I can run generic/001 to completion with that transport.

David

---
commit 820cb3802c6a73c54e2e215b674eb5870fd5d0e5
Author: David Howells <dhowells@redhat.com>
Date:   Wed Jan 25 12:42:07 2023 +0000

    cifs: Fix oops due to uncleared server->smbd_conn in reconnect
    
    In smbd_destroy(), clear the server->smbd_conn pointer after freeing the
    smbd_connection struct that it points to so that reconnection doesn't get
    confused.
    
    Fixes: 8ef130f9ec27 ("CIFS: SMBD: Implement function to destroy a SMB Direct connection")
    Signed-off-by: David Howells <dhowells@redhat.com>
    cc: Long Li <longli@microsoft.com>
    cc: Steve French <smfrench@gmail.com>
    cc: Pavel Shilovsky <pshilov@microsoft.com>
    cc: Ronnie Sahlberg <lsahlber@redhat.com>
    cc: linux-cifs@vger.kernel.org

diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index 90789aaa6567..8c816b25ce7c 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -1405,6 +1405,7 @@ void smbd_destroy(struct TCP_Server_Info *server)
 	destroy_workqueue(info->workqueue);
 	log_rdma_event(INFO,  "rdma session destroyed\n");
 	kfree(info);
+	server->smbd_conn = NULL;
 }
 
 /*


  parent reply	other threads:[~2023-01-25 14:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 17:48 cifs-rdma: KASAN-detected UAF when using rxe driver David Howells
2023-01-25  7:48 ` David Howells
2023-01-25 14:02 ` David Howells [this message]
2023-01-25 14:47   ` [PATCH] cifs: Fix oops due to uncleared server->smbd_conn in reconnect Tom Talpey
2023-01-26 15:20     ` David Howells
2023-01-26 19:22       ` Tom Talpey
2023-01-26 19:49         ` David Howells
2023-01-25 15:52   ` Tom Talpey
2023-01-25 20:41     ` David Howells
2023-01-25 22:24       ` Tom Talpey
2023-01-25 22:43         ` David Howells
2023-01-25 22:56           ` Tom Talpey
2023-01-26 14:42             ` pcap of misbehaving fallocate over cifs rdma David Howells
     [not found]               ` <CAH2r5mupuFEw4hY7uOYjeHi08pS9vv3n30KppR_CTrKZ4xAdnw@mail.gmail.com>
2023-01-26 19:54                 ` David Howells
2023-01-26 20:29                   ` Tom Talpey
2023-01-26 20:47                     ` David Howells
2023-01-25 23:42           ` [PATCH] cifs: Fix oops due to uncleared server->smbd_conn in reconnect Namjae Jeon
2023-01-25 16:20   ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2132364.1674655333@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=jlayton@kernel.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=metze@samba.org \
    --cc=nspmangalore@gmail.com \
    --cc=rohiths.msft@gmail.com \
    --cc=sfrench@samba.org \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox