diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2021-11-06 14:31:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-12-01 11:04:55 +0300 |
commit | a96c6f0bbba6272f0e85e8748c0ee4522d026f3b (patch) | |
tree | 15b9c59a64b64c9de174b679c9ad10b22c89ca15 /fs/cifs/connect.c | |
parent | 98805da98d93e6cf4e96d2f2aa5eaecc730722b9 (diff) | |
download | linux-a96c6f0bbba6272f0e85e8748c0ee4522d026f3b.tar.xz |
cifs: nosharesock should not share socket with future sessions
[ Upstream commit c9f1c19cf7c50949885fa5afdb2cb242d61a7fac ]
Today, when a new mount is done with nosharesock, we ensure
that we don't select an existing matching session. However,
we don't mark the connection as nosharesock, which means that
those could be shared with future sessions.
Fixed it with this commit. Also printing this info in DebugData.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index e757ee52cc77..d26703a05c6b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1217,7 +1217,13 @@ static int match_server(struct TCP_Server_Info *server, struct smb3_fs_context * { struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr; - if (ctx->nosharesock) + if (ctx->nosharesock) { + server->nosharesock = true; + return 0; + } + + /* this server does not share socket */ + if (server->nosharesock) return 0; /* If multidialect negotiation see if existing sessions match one */ |