From: Greg Kroah-Hartman Date: Mon, 29 Nov 2021 13:32:39 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v5.15.6~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63549222302a7c99184bf15a977d934c0b910c92;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: cifs-nosharesock-should-be-set-on-new-server.patch --- diff --git a/queue-5.15/cifs-nosharesock-should-be-set-on-new-server.patch b/queue-5.15/cifs-nosharesock-should-be-set-on-new-server.patch new file mode 100644 index 00000000000..33322355dad --- /dev/null +++ b/queue-5.15/cifs-nosharesock-should-be-set-on-new-server.patch @@ -0,0 +1,48 @@ +From b9ad6b5b687e798746024e5fc4574d8fa8bdfade Mon Sep 17 00:00:00 2001 +From: Shyam Prasad N +Date: Sun, 21 Nov 2021 16:45:44 +0000 +Subject: cifs: nosharesock should be set on new server + +From: Shyam Prasad N + +commit b9ad6b5b687e798746024e5fc4574d8fa8bdfade upstream. + +Recent fix to maintain a nosharesock state on the +server struct caused a regression. It updated this +field in the old tcp session, and not the new one. + +This caused the multichannel scenario to misbehave. + +Fixes: c9f1c19cf7c5 (cifs: nosharesock should not share socket with future sessions) +Signed-off-by: Shyam Prasad N +Reviewed-by: Paulo Alcantara (SUSE) +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/connect.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -1217,10 +1217,8 @@ static int match_server(struct TCP_Serve + { + struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr; + +- if (ctx->nosharesock) { +- server->nosharesock = true; ++ if (ctx->nosharesock) + return 0; +- } + + /* this server does not share socket */ + if (server->nosharesock) +@@ -1376,6 +1374,9 @@ cifs_get_tcp_session(struct smb3_fs_cont + goto out_err; + } + ++ if (ctx->nosharesock) ++ tcp_ses->nosharesock = true; ++ + tcp_ses->ops = ctx->ops; + tcp_ses->vals = ctx->vals; + cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns)); diff --git a/queue-5.15/series b/queue-5.15/series index ba3507bc7f7..48d9752ae40 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -168,3 +168,4 @@ vdpa_sim-avoid-putting-an-uninitialized-iova_domain.patch vhost-vsock-fix-incorrect-used-length-reported-to-the-guest.patch ksmbd-fix-an-error-handling-path-in-smb2_sess_setup.patch tracing-check-pid-filtering-when-creating-events.patch +cifs-nosharesock-should-be-set-on-new-server.patch