[bionic] smb3: on reconnect set PreviousSessionId field

Message ID 20180809124312.2018-1-marcelo.cerri@canonical.com
State New
Headers show
Series
  • [bionic] smb3: on reconnect set PreviousSessionId field
Related show

Commit Message

Marcelo Henrique Cerri Aug. 9, 2018, 12:43 p.m.
From: Steve French <stfrench@microsoft.com>

BugLink: http://bugs.launchpad.net/bugs/1786110

The server detects reconnect by the (non-zero) value in PreviousSessionId
of SMB2/SMB3 SessionSetup request, but this behavior regressed due
to commit 166cea4dc3a4f66f020cfb9286225ecd228ab61d
("SMB2: Separate RawNTLMSSP authentication from SMB2_sess_setup")

CC: Stable <stable@vger.kernel.org>
CC: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
(cherry picked from commit b2adf22fdfba85a6701c481faccdbbb3a418ccfc)
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
---
 fs/cifs/smb2pdu.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefan Bader Aug. 16, 2018, 9:18 a.m. | #1
On 09.08.2018 14:43, Marcelo Henrique Cerri wrote:
> From: Steve French <stfrench@microsoft.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1786110
> 
> The server detects reconnect by the (non-zero) value in PreviousSessionId
> of SMB2/SMB3 SessionSetup request, but this behavior regressed due
> to commit 166cea4dc3a4f66f020cfb9286225ecd228ab61d
> ("SMB2: Separate RawNTLMSSP authentication from SMB2_sess_setup")
> 
> CC: Stable <stable@vger.kernel.org>
> CC: Sachin Prabhu <sprabhu@redhat.com>
> Signed-off-by: Steve French <smfrench@gmail.com>
> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
> (cherry picked from commit b2adf22fdfba85a6701c481faccdbbb3a418ccfc)
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  fs/cifs/smb2pdu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 18bf0b9f19ed..f942827ca0cb 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -1181,6 +1181,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
>  	sess_data->ses = ses;
>  	sess_data->buf0_type = CIFS_NO_BUFFER;
>  	sess_data->nls_cp = (struct nls_table *) nls_cp;
> +	sess_data->previous_session = ses->Suid;
>  
>  	while (sess_data->func)
>  		sess_data->func(sess_data);
>
Kamal Mostafa Aug. 16, 2018, 4:39 p.m. | #2
Acked-by: Kamal Mostafa <kamal@canonical.com>

On Thu, Aug 09, 2018 at 09:43:12AM -0300, Marcelo Henrique Cerri wrote:
> From: Steve French <stfrench@microsoft.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1786110
> 
> The server detects reconnect by the (non-zero) value in PreviousSessionId
> of SMB2/SMB3 SessionSetup request, but this behavior regressed due
> to commit 166cea4dc3a4f66f020cfb9286225ecd228ab61d
> ("SMB2: Separate RawNTLMSSP authentication from SMB2_sess_setup")
> 
> CC: Stable <stable@vger.kernel.org>
> CC: Sachin Prabhu <sprabhu@redhat.com>
> Signed-off-by: Steve French <smfrench@gmail.com>
> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
> (cherry picked from commit b2adf22fdfba85a6701c481faccdbbb3a418ccfc)
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> ---
>  fs/cifs/smb2pdu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 18bf0b9f19ed..f942827ca0cb 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -1181,6 +1181,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
>  	sess_data->ses = ses;
>  	sess_data->buf0_type = CIFS_NO_BUFFER;
>  	sess_data->nls_cp = (struct nls_table *) nls_cp;
> +	sess_data->previous_session = ses->Suid;
>  
>  	while (sess_data->func)
>  		sess_data->func(sess_data);
> -- 
> 2.17.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Khaled Elmously Aug. 21, 2018, 6 a.m. | #3
to bionic/master-next


On 2018-08-09 09:43:12 , Marcelo Henrique Cerri wrote:
> From: Steve French <stfrench@microsoft.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1786110
> 
> The server detects reconnect by the (non-zero) value in PreviousSessionId
> of SMB2/SMB3 SessionSetup request, but this behavior regressed due
> to commit 166cea4dc3a4f66f020cfb9286225ecd228ab61d
> ("SMB2: Separate RawNTLMSSP authentication from SMB2_sess_setup")
> 
> CC: Stable <stable@vger.kernel.org>
> CC: Sachin Prabhu <sprabhu@redhat.com>
> Signed-off-by: Steve French <smfrench@gmail.com>
> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
> (cherry picked from commit b2adf22fdfba85a6701c481faccdbbb3a418ccfc)
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> ---
>  fs/cifs/smb2pdu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 18bf0b9f19ed..f942827ca0cb 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -1181,6 +1181,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
>  	sess_data->ses = ses;
>  	sess_data->buf0_type = CIFS_NO_BUFFER;
>  	sess_data->nls_cp = (struct nls_table *) nls_cp;
> +	sess_data->previous_session = ses->Suid;
>  
>  	while (sess_data->func)
>  		sess_data->func(sess_data);
> -- 
> 2.17.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Patch

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 18bf0b9f19ed..f942827ca0cb 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1181,6 +1181,7 @@  SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
 	sess_data->ses = ses;
 	sess_data->buf0_type = CIFS_NO_BUFFER;
 	sess_data->nls_cp = (struct nls_table *) nls_cp;
+	sess_data->previous_session = ses->Suid;
 
 	while (sess_data->func)
 		sess_data->func(sess_data);