[SRU,Bionic,1/1] cifs: connect to servername instead of IP for IPC$ share

Message ID 2384a36940b18da847f7f17c6b13b5c77dbc67a3.1541010709.git.joseph.salisbury@canonical.com
State New
Headers show
Series
  • cifs: connect to servername instead of IP for IPC$ share
Related show

Commit Message

Joseph Salisbury Oct. 31, 2018, 6:39 p.m.
From: Thomas Werschlein <thomas.werschlein@geo.uzh.ch>

BugLink: https://bugs.launchpad.net/bugs/1792580

This patch is required allows access to a Microsoft fileserver failover
cluster behind a 1:1 NAT firewall.

The change also provides stronger context for authentication and share
connection (see MS-SMB2 3.3.5.7 and MS-SRVS 3.1.6.8) as noted by
Tom Talpey, and addresses comments about the buffer size for the UNC
made by Aurélien Aptel.

Signed-off-by: Thomas Werschlein <thomas.werschlein@geo.uzh.ch>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Tom Talpey <ttalpey@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
CC: Stable <stable@vger.kernel.org>
(cherry picked from commit 395a2076b4064f97d3fce03af15210ff2a7bb7f9)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 fs/cifs/connect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Bader Nov. 6, 2018, 12:30 p.m. | #1
On 31.10.18 19:39, Joseph Salisbury wrote:
> From: Thomas Werschlein <thomas.werschlein@geo.uzh.ch>
> 
> BugLink: https://bugs.launchpad.net/bugs/1792580
> 
> This patch is required allows access to a Microsoft fileserver failover
> cluster behind a 1:1 NAT firewall.
> 
> The change also provides stronger context for authentication and share
> connection (see MS-SMB2 3.3.5.7 and MS-SRVS 3.1.6.8) as noted by
> Tom Talpey, and addresses comments about the buffer size for the UNC
> made by Aurélien Aptel.
> 
> Signed-off-by: Thomas Werschlein <thomas.werschlein@geo.uzh.ch>
> Signed-off-by: Steve French <stfrench@microsoft.com>
> CC: Tom Talpey <ttalpey@microsoft.com>
> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
> CC: Stable <stable@vger.kernel.org>
> (cherry picked from commit 395a2076b4064f97d3fce03af15210ff2a7bb7f9)
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  fs/cifs/connect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index e3026e2..3d9ef02 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -2415,7 +2415,7 @@ cifs_setup_ipc(struct cifs_ses *ses, struct smb_vol *volume_info)
>  	if (tcon == NULL)
>  		return -ENOMEM;
>  
> -	snprintf(unc, sizeof(unc), "\\\\%s\\IPC$", ses->serverName);
> +	snprintf(unc, sizeof(unc), "\\\\%s\\IPC$", ses->server->hostname);
>  
>  	/* cannot fail */
>  	nls_codepage = load_nls_default();
>
Kleber Sacilotto de Souza Nov. 6, 2018, 5:01 p.m. | #2
On 10/31/18 19:39, Joseph Salisbury wrote:
> From: Thomas Werschlein <thomas.werschlein@geo.uzh.ch>
>
> BugLink: https://bugs.launchpad.net/bugs/1792580
>
> This patch is required allows access to a Microsoft fileserver failover
> cluster behind a 1:1 NAT firewall.
>
> The change also provides stronger context for authentication and share
> connection (see MS-SMB2 3.3.5.7 and MS-SRVS 3.1.6.8) as noted by
> Tom Talpey, and addresses comments about the buffer size for the UNC
> made by Aurélien Aptel.
>
> Signed-off-by: Thomas Werschlein <thomas.werschlein@geo.uzh.ch>
> Signed-off-by: Steve French <stfrench@microsoft.com>
> CC: Tom Talpey <ttalpey@microsoft.com>
> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
> CC: Stable <stable@vger.kernel.org>
> (cherry picked from commit 395a2076b4064f97d3fce03af15210ff2a7bb7f9)
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  fs/cifs/connect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index e3026e2..3d9ef02 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -2415,7 +2415,7 @@ cifs_setup_ipc(struct cifs_ses *ses, struct smb_vol *volume_info)
>  	if (tcon == NULL)
>  		return -ENOMEM;
>  
> -	snprintf(unc, sizeof(unc), "\\\\%s\\IPC$", ses->serverName);
> +	snprintf(unc, sizeof(unc), "\\\\%s\\IPC$", ses->server->hostname);
>  
>  	/* cannot fail */
>  	nls_codepage = load_nls_default();

Patch

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e3026e2..3d9ef02 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2415,7 +2415,7 @@  cifs_setup_ipc(struct cifs_ses *ses, struct smb_vol *volume_info)
 	if (tcon == NULL)
 		return -ENOMEM;
 
-	snprintf(unc, sizeof(unc), "\\\\%s\\IPC$", ses->serverName);
+	snprintf(unc, sizeof(unc), "\\\\%s\\IPC$", ses->server->hostname);
 
 	/* cannot fail */
 	nls_codepage = load_nls_default();