From patchwork Mon Oct 28 11:03:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 13853306 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EFDB1DA112; Mon, 28 Oct 2024 11:04:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; cv=none; b=tPVUbZxkoqdMUNE2UYvKDofFy64MhimYLM2o0IeTl8pW4GLoPCPzvDLaQjPdwz41g+3MINDhI4qMNc5/IokEss/Yzb8uxbSGwPxLj+1Eoe3Y+njGAE/ydl7c2jlaPUDv5rRJeOqxy2wIx3BdFbsaXvlg9VOgmqp9wVn3jZCuS9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; c=relaxed/simple; bh=lilCn/ZYvgSMRrOEX8KpbukOjpF8bvRRKM0fwMp7ao4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=RA2GDSJiTlx6dqxPiNJHq2K3q7uTEJHOJu7mwMHOienxNfj/tiGCTbxloc9Bot6zgU7nFm2dHkKYmn1imUaqCNyzjyP2UV39hZKSS01lBEhvrkh1b5minwJcqdlLr1DhQVrnwsABnEEQmp+Y6Yp2QGEvRHDJXD3LeSohFoADLjY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JcqP/dPE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JcqP/dPE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A7F6C4CEE7; Mon, 28 Oct 2024 11:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730113465; bh=lilCn/ZYvgSMRrOEX8KpbukOjpF8bvRRKM0fwMp7ao4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JcqP/dPE4OjSFrP4HwnWmwqG1FP2W30QMYtNx8FUM/Y1ef8eLeAGbASuJQrueW5Y+ Ro+2iURgedTKo8gEl3KgiBSITm7Ktggc3UTiTQg0v/NbutdMlpaYSytv6vdIeXhHow WDbskQueORk5j7COS8RdVmQStl36W+JAjb97Go7OgVf2J4K8HfABZWeEWMyUuObFoN ziCFZePj4vD8SbQTGqd+ZHO7i5YmJ+36cfwaWrJbcTBdv4WuXY/PuMoyve9circFn+ fGX12BF4SsSRIURLYZBg8GiFQZE3c8l7SSCbIvMfNXDNfJYbOfcQTA3+U7OA3GKUpH GM4/eH9Z4S6ig== Received: by pali.im (Postfix) id 2FB51AB1; Mon, 28 Oct 2024 12:04:18 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Steve French , Paulo Alcantara , Ronnie Sahlberg Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] cifs: Add new mount option -o nounicode to disable SMB1 UNICODE mode Date: Mon, 28 Oct 2024 12:03:36 +0100 Message-Id: <20241028110340.29911-2-pali@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241028110340.29911-1-pali@kernel.org> References: <20241028110340.29911-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SMB1 protocol supports non-UNICODE (8-bit OEM character set) and UNICODE (UTF-16) modes. Linux SMB1 client implements both of them but currently does not allow to choose non-UNICODE mode when SMB1 server announce UNICODE mode support. This change adds a new mount option -o nounicode to disable UNICODE mode and force usage of non-UNICODE (8-bit OEM character set) mode. This allows to test non-UNICODE implementation of Linux SMB1 client against any SMB1 server, including modern and recent Windows SMB1 server. Signed-off-by: Pali Rohár --- fs/smb/client/cifsfs.c | 4 ++++ fs/smb/client/cifsglob.h | 2 ++ fs/smb/client/cifssmb.c | 5 ++++- fs/smb/client/connect.c | 32 +++++++++++++++++++++++++++++--- fs/smb/client/fs_context.c | 11 +++++++++++ fs/smb/client/fs_context.h | 2 ++ fs/smb/client/sess.c | 1 + fs/smb/client/smb1ops.c | 1 + 8 files changed, 54 insertions(+), 4 deletions(-) diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c index 1decf91d3f61..447ed7831f2c 100644 --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -611,6 +611,10 @@ cifs_show_options(struct seq_file *s, struct dentry *root) cifs_sb->ctx->dir_mode); if (cifs_sb->ctx->iocharset) seq_printf(s, ",iocharset=%s", cifs_sb->ctx->iocharset); + if (tcon->ses->unicode == 0) + seq_puts(s, ",nounicode"); + else if (tcon->ses->unicode == 1) + seq_puts(s, ",unicode"); if (tcon->seal) seq_puts(s, ",seal"); else if (tcon->ses->server->ignore_signature) diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index dcee43889358..2f77b558abe8 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -651,6 +651,7 @@ struct smb_version_values { unsigned int cap_unix; unsigned int cap_nt_find; unsigned int cap_large_files; + unsigned int cap_unicode; __u16 signing_enabled; __u16 signing_required; size_t create_lease_size; @@ -1124,6 +1125,7 @@ struct cifs_ses { bool sign; /* is signing required? */ bool domainAuto:1; bool expired_pwd; /* track if access denied or expired pwd so can know if need to update */ + int unicode; unsigned int flags; __u16 session_flags; __u8 smb3signingkey[SMB3_SIGN_KEY_SIZE]; diff --git a/fs/smb/client/cifssmb.c b/fs/smb/client/cifssmb.c index c6f15dbe860a..6218b59b9da7 100644 --- a/fs/smb/client/cifssmb.c +++ b/fs/smb/client/cifssmb.c @@ -423,7 +423,10 @@ CIFSSMBNegotiate(const unsigned int xid, return rc; pSMB->hdr.Mid = get_next_mid(server); - pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS); + pSMB->hdr.Flags2 |= SMBFLG2_ERR_STATUS; + + if (ses->unicode != 0) + pSMB->hdr.Flags2 |= SMBFLG2_UNICODE; if (should_set_ext_sec_flag(ses->sectype)) { cifs_dbg(FYI, "Requesting extended security\n"); diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 612816ec71f5..3d9d736b6e58 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -2338,6 +2338,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx) ses->cred_uid = ctx->cred_uid; ses->linux_uid = ctx->linux_uid; + ses->unicode = ctx->unicode; ses->sectype = ctx->sectype; ses->sign = ctx->sign; ses->local_nls = load_nls(ctx->local_nls->charset); @@ -3928,7 +3929,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses, struct TCP_Server_Info *server, struct nls_table *nls_info) { - int rc = -ENOSYS; + int rc = 0; struct TCP_Server_Info *pserver = SERVER_IS_CHAN(server) ? server->primary_server : server; struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&pserver->dstaddr; struct sockaddr_in *addr = (struct sockaddr_in *)&pserver->dstaddr; @@ -3980,6 +3981,26 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses, if (!linuxExtEnabled) ses->capabilities &= (~server->vals->cap_unix); + /* + * Check if the server supports specified encoding mode. + * Zero value in vals->cap_unicode indidcates that chosen + * protocol dialect does not support non-UNICODE mode. + */ + if (ses->unicode == 1 && server->vals->cap_unicode != 0 && + !(server->capabilities & server->vals->cap_unicode)) { + cifs_dbg(VFS, "Server does not support mounting in UNICODE mode\n"); + rc = -EOPNOTSUPP; + } else if (ses->unicode == 0 && server->vals->cap_unicode == 0) { + cifs_dbg(VFS, "Server does not support mounting in non-UNICODE mode\n"); + rc = -EOPNOTSUPP; + } else if (ses->unicode == 0) { + /* + * When UNICODE mode was explicitly disabled then + * do not announce client UNICODE capability. + */ + ses->capabilities &= (~server->vals->cap_unicode); + } + if (ses->auth_key.response) { cifs_dbg(FYI, "Free previous auth_key.response = %p\n", ses->auth_key.response); @@ -3992,8 +4013,12 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses, cifs_dbg(FYI, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d\n", server->sec_mode, server->capabilities, server->timeAdj); - if (server->ops->sess_setup) - rc = server->ops->sess_setup(xid, ses, server, nls_info); + if (!rc) { + if (server->ops->sess_setup) + rc = server->ops->sess_setup(xid, ses, server, nls_info); + else + rc = -ENOSYS; + } if (rc) { cifs_server_dbg(VFS, "Send error in SessSetup = %d\n", rc); @@ -4063,6 +4088,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) ctx->seal = master_tcon->seal; ctx->witness = master_tcon->use_witness; ctx->dfs_root_ses = master_tcon->ses->dfs_root_ses; + ctx->unicode = master_tcon->ses->unicode; rc = cifs_set_vol_auth(ctx, master_tcon->ses); if (rc) { diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index 7dd46cfc9fb3..d970b66e529c 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -127,6 +127,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = { fsparam_flag("rootfs", Opt_rootfs), fsparam_flag("compress", Opt_compress), fsparam_flag("witness", Opt_witness), + fsparam_flag_no("unicode", Opt_unicode), /* Mount options which take uid or gid */ fsparam_uid("backupuid", Opt_backupuid), @@ -930,6 +931,10 @@ static int smb3_verify_reconfigure_ctx(struct fs_context *fc, cifs_errorf(fc, "can not change iocharset during remount\n"); return -EINVAL; } + if (new_ctx->unicode != old_ctx->unicode) { + cifs_errorf(fc, "can not change unicode during remount\n"); + return -EINVAL; + } return 0; } @@ -1520,6 +1525,10 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ctx->witness = true; pr_warn_once("Witness protocol support is experimental\n"); break; + case Opt_unicode: + ctx->unicode = !result.negated; + cifs_dbg(FYI, "unicode set to %d\n", ctx->unicode); + break; case Opt_rootfs: #ifndef CONFIG_CIFS_ROOT cifs_dbg(VFS, "rootfs support requires CONFIG_CIFS_ROOT config option\n"); @@ -1816,6 +1825,8 @@ int smb3_init_fs_context(struct fs_context *fc) ctx->symlink_type = CIFS_SYMLINK_TYPE_DEFAULT; ctx->nonativesocket = 0; + ctx->unicode = -1; /* autodetect, but prefer UNICODE mode */ + /* * short int override_uid = -1; * short int override_gid = -1; diff --git a/fs/smb/client/fs_context.h b/fs/smb/client/fs_context.h index 18d39d457145..1514e05e6629 100644 --- a/fs/smb/client/fs_context.h +++ b/fs/smb/client/fs_context.h @@ -127,6 +127,7 @@ enum cifs_param { Opt_multichannel, Opt_compress, Opt_witness, + Opt_unicode, /* Mount options which take numeric value */ Opt_backupuid, @@ -296,6 +297,7 @@ struct smb3_fs_context { bool compress; /* enable SMB2 messages (READ/WRITE) de/compression */ bool rootfs:1; /* if it's a SMB root file system */ bool witness:1; /* use witness protocol */ + int unicode; char *leaf_fullpath; struct cifs_ses *dfs_root_ses; bool dfs_automount:1; /* set for dfs automount only */ diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index c88e9657f47a..6a92db287843 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -529,6 +529,7 @@ cifs_ses_add_channel(struct cifs_ses *ses, ctx->password = ses->password; ctx->sectype = ses->sectype; ctx->sign = ses->sign; + ctx->unicode = ses->unicode; /* UNC and paths */ /* XXX: Use ses->server->hostname? */ diff --git a/fs/smb/client/smb1ops.c b/fs/smb/client/smb1ops.c index abca214f923c..b0fb4a5c586d 100644 --- a/fs/smb/client/smb1ops.c +++ b/fs/smb/client/smb1ops.c @@ -1189,6 +1189,7 @@ struct smb_version_values smb1_values = { .cap_unix = CAP_UNIX, .cap_nt_find = CAP_NT_SMBS | CAP_NT_FIND, .cap_large_files = CAP_LARGE_FILES, + .cap_unicode = CAP_UNICODE, .signing_enabled = SECMODE_SIGN_ENABLED, .signing_required = SECMODE_SIGN_REQUIRED, }; From patchwork Mon Oct 28 11:03:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 13853305 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F0361DA309; Mon, 28 Oct 2024 11:04:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; cv=none; b=fX1Zy3/AOx99QiAbSnp9jmhJhKG97iXDBbL8G1xiCXWbcIZKCmZ075eex17bRap4W2fa1pB41lac4wZfME3CcyM4+FCn21n7KzRrgic5zqkXj7F+5cJA8HTRSKk1+6cRx/4Fl/SYOWlcljvK4Lc7uX5ffNJiUh2OgzfFU78s5L4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; c=relaxed/simple; bh=bm+RRqbe/JhESROs99jQSB63rwUhxOeEc+sxxBHydlM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=iaIBWPlrxTP8Sx5c5lQkVzVCsaNfAqq8Vj8hQqpdnx7NLa4Ks/bFwdfTVit5XV7qo7vEeMdrsWX/7aC0eaZKfoi1PydXRbpkfaPZHae2iStqYM+xisUH4VKzQzRLuDGR8ITvHsRGxMQbJwOS8PovSns8v1yI0qf5LOTM0aW301I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A1g8JaSc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A1g8JaSc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67DBDC4CEE4; Mon, 28 Oct 2024 11:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730113465; bh=bm+RRqbe/JhESROs99jQSB63rwUhxOeEc+sxxBHydlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A1g8JaScxncUmzZwTQU01Kd4wydn2gIFmD+oL0YhyjU3/6Kt4nNLtfk543EKDv2zC 6dmIYWraE0Cn0ZjL1igACgXhZMwnxgBgNWetNdxk7JImZfnlnsjAmVGdVCoDCGjmZM 7vQaJca5mmX7doJZmI4dYqD9Fpr5zWOXhFNK6Ul1HMy+CXO/CBV7xpF5WgS+HQ9xmY b+xe2W0jOvJ/W6dXB0R1P90gIicVXCP4447ZHu3LQFurnEbl/yAJQ1IiNuzSoFbmM7 8ZHcDpyPQ+pAqiLKN1ej3gKZbPRgk8F3uGWUqrx6Dui44Xx8xbnc9uqK5PWc2uGyr6 nraCks0nvIfuA== Received: by pali.im (Postfix) id 66E51AB4; Mon, 28 Oct 2024 12:04:18 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Steve French , Paulo Alcantara , Ronnie Sahlberg Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] cifs: Fix encoding of SMB1 Session Setup Kerberos Request in non-UNICODE mode Date: Mon, 28 Oct 2024 12:03:37 +0100 Message-Id: <20241028110340.29911-3-pali@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241028110340.29911-1-pali@kernel.org> References: <20241028110340.29911-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Like in UNICODE mode, SMB1 Session Setup Kerberos Request contains oslm and domain strings. Extract common code into ascii_oslm_strings() and ascii_domain_string() functions (similar to unicode variants) and use these functions in non-UNICODE code path in sess_auth_kerberos(). Decision if non-UNICODE or UNICODE mode is used is based on the SMBFLG2_UNICODE flag in Flags2 packed field, and not based on the capabilities of server. Fix this check too. Signed-off-by: Pali Rohár --- fs/smb/client/sess.c | 60 +++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index 6a92db287843..7226f2563b99 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -701,6 +701,22 @@ unicode_oslm_strings(char **pbcc_area, const struct nls_table *nls_cp) *pbcc_area = bcc_ptr; } +static void +ascii_oslm_strings(char **pbcc_area, const struct nls_table *nls_cp) +{ + char *bcc_ptr = *pbcc_area; + + strcpy(bcc_ptr, "Linux version "); + bcc_ptr += strlen("Linux version "); + strcpy(bcc_ptr, init_utsname()->release); + bcc_ptr += strlen(init_utsname()->release) + 1; + + strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); + bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; + + *pbcc_area = bcc_ptr; +} + static void unicode_domain_string(char **pbcc_area, struct cifs_ses *ses, const struct nls_table *nls_cp) { @@ -725,6 +741,25 @@ static void unicode_domain_string(char **pbcc_area, struct cifs_ses *ses, *pbcc_area = bcc_ptr; } +static void ascii_domain_string(char **pbcc_area, struct cifs_ses *ses, + const struct nls_table *nls_cp) +{ + char *bcc_ptr = *pbcc_area; + int len; + + /* copy domain */ + if (ses->domainName != NULL) { + len = strscpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN); + if (WARN_ON_ONCE(len < 0)) + len = CIFS_MAX_DOMAINNAME_LEN - 1; + bcc_ptr += len; + } /* else we send a null domain name so server will default to its own domain */ + *bcc_ptr = 0; + bcc_ptr++; + + *pbcc_area = bcc_ptr; +} + static void unicode_ssetup_strings(char **pbcc_area, struct cifs_ses *ses, const struct nls_table *nls_cp) { @@ -770,25 +805,10 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifs_ses *ses, *bcc_ptr = 0; bcc_ptr++; /* account for null termination */ - /* copy domain */ - if (ses->domainName != NULL) { - len = strscpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN); - if (WARN_ON_ONCE(len < 0)) - len = CIFS_MAX_DOMAINNAME_LEN - 1; - bcc_ptr += len; - } /* else we send a null domain name so server will default to its own domain */ - *bcc_ptr = 0; - bcc_ptr++; - /* BB check for overflow here */ - strcpy(bcc_ptr, "Linux version "); - bcc_ptr += strlen("Linux version "); - strcpy(bcc_ptr, init_utsname()->release); - bcc_ptr += strlen(init_utsname()->release) + 1; - - strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); - bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; + ascii_domain_string(&bcc_ptr, ses, nls_cp); + ascii_oslm_strings(&bcc_ptr, nls_cp); *pbcc_area = bcc_ptr; } @@ -1590,7 +1610,7 @@ sess_auth_kerberos(struct sess_data *sess_data) sess_data->iov[1].iov_len = msg->secblob_len; pSMB->req.SecurityBlobLength = cpu_to_le16(sess_data->iov[1].iov_len); - if (ses->capabilities & CAP_UNICODE) { + if (pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) { /* unicode strings must be word aligned */ if (!IS_ALIGNED(sess_data->iov[0].iov_len + sess_data->iov[1].iov_len, 2)) { *bcc_ptr = 0; @@ -1599,8 +1619,8 @@ sess_auth_kerberos(struct sess_data *sess_data) unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp); unicode_domain_string(&bcc_ptr, ses, sess_data->nls_cp); } else { - /* BB: is this right? */ - ascii_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); + ascii_oslm_strings(&bcc_ptr, sess_data->nls_cp); + ascii_domain_string(&bcc_ptr, ses, sess_data->nls_cp); } sess_data->iov[2].iov_len = (long) bcc_ptr - From patchwork Mon Oct 28 11:03:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 13853307 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CE2D1DE2DA; Mon, 28 Oct 2024 11:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; cv=none; b=Bx/lN9pjrFhBUBoH/2prM00Jbj1EHR4TtoSxJktH1xKYw2svK+RwhAuoCeN9n5EAczduwj7eY1rJmq3Zm7yhQJlBPKL6Y61N2XScrYtcLtCMpbjhltiQvpWwSEgyPK8mx+MT9FavAFCv/vKrjSnz9z1EDMUlh098Tssjw9HZ6Uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; c=relaxed/simple; bh=WHtLiJHjirtfbEslTsmtV/oBQXUhlLaEDksL+A80+5Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=amL0U7G3NK4f3zSP8p8bMtpHBj/Czim6SuVDiqwhNF913ZqLX+gub6nZqb72lZ9zM07DVYG+WNNxzkbJx775yiUB5YbwSH0GJ/espTy4xTe7YNRv1JTUXdP99HglURNADISq2iR36CqVjxmnxpYDyjTTXHDJGV7O+HqCG3Scdas= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gEol7T5U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gEol7T5U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8653C4CEE3; Mon, 28 Oct 2024 11:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730113466; bh=WHtLiJHjirtfbEslTsmtV/oBQXUhlLaEDksL+A80+5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gEol7T5U/A6egd5SelcyuFSXmvhJWM0P42bTsgE7L7QbJ6YQ6kv09Pto0PIpsHdiR OEihNsgmdvN42ZoZE6BMlK8za7M/S6W8w1jerCk0lUOxYn1v9G+1fctRJvwQ8dBnsb EBc6AGYms2cKhz4ru/DcvdP29kHJVWKeyuimOhv+k4f8iAEj/Z6plm+11OPXx2jkrz sfAu1ouaOi+x4Qebr+U4c7OoQ0WUYWCNHC/3OXhXJ6heyQxLplJ62WLjaAk/Vq6ifa QelNEGpaCqY4iyEFqmUUlEO0/R/O7Q9xzsKmG0xgw+ElPOUyyJG2gfSSmbHmllaMr+ T4UW2MKE/Q4IQ== Received: by pali.im (Postfix) id 91BC0BB0; Mon, 28 Oct 2024 12:04:18 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Steve French , Paulo Alcantara , Ronnie Sahlberg Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] cifs: Add support for SMB1 Session Setup NTLMSSP Request in non-UNICODE mode Date: Mon, 28 Oct 2024 12:03:38 +0100 Message-Id: <20241028110340.29911-4-pali@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241028110340.29911-1-pali@kernel.org> References: <20241028110340.29911-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SMB1 Session Setup NTLMSSP Request in non-UNICODE mode is similar to UNICODE mode, just strings are encoded in ASCII and not in UTF-16. With this change it is possible to setup SMB1 session with NTLM authentication in non-UNICODE mode with Windows SMB server. Signed-off-by: Pali Rohár --- fs/smb/client/sess.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index 7226f2563b99..29a1756ba0f7 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -1704,22 +1704,22 @@ _sess_auth_rawntlmssp_assemble_req(struct sess_data *sess_data) pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; capabilities = cifs_ssetup_hdr(ses, server, pSMB); - if ((pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) == 0) { - cifs_dbg(VFS, "NTLMSSP requires Unicode support\n"); - return -ENOSYS; - } - pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; capabilities |= CAP_EXTENDED_SECURITY; pSMB->req.Capabilities |= cpu_to_le32(capabilities); bcc_ptr = sess_data->iov[2].iov_base; - /* unicode strings must be word aligned */ - if (!IS_ALIGNED(sess_data->iov[0].iov_len + sess_data->iov[1].iov_len, 2)) { - *bcc_ptr = 0; - bcc_ptr++; + + if (pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) { + /* unicode strings must be word aligned */ + if (!IS_ALIGNED(sess_data->iov[0].iov_len + sess_data->iov[1].iov_len, 2)) { + *bcc_ptr = 0; + bcc_ptr++; + } + unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp); + } else { + ascii_oslm_strings(&bcc_ptr, sess_data->nls_cp); } - unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp); sess_data->iov[2].iov_len = (long) bcc_ptr - (long) sess_data->iov[2].iov_base; From patchwork Mon Oct 28 11:03:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 13853308 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B8A71DE2DF; Mon, 28 Oct 2024 11:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; cv=none; b=EE/9s2+UEeaV4jUt3KeK+HR6o3pMGmTptg52ZTL97uQH6VJS8RubBuij73XpzcduHGeSJt8mF+p5bBEb9zHR6LbrwHGFZOx9ILBNZD9Ov7947w7amZ4i11pNqDJgICAr0VkPVCplXVwh6/QagGgP1qHv34sIIDOVMVAT2A/p9dQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; c=relaxed/simple; bh=+KsPW+UwOATIiva30fDwDf9YFBwdccBWJBjRe5rPAXY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=hLJFUtgWc5/UIhjYujmv0XlpSq906o3xcCOnwxgxlD2a8WJTDp/SlvJkQUcMfr24Bmy4YzjDfw5njeNAQ3BISLIU3fCZZFnoVQ2W4U2LNjyp8JH/wwoygJgrd1IObNjZyUxgsd/BTDILvelOCwu9Azr9DXo82t4rGDM3Mdq7fjM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r/YzKaXp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r/YzKaXp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B865C4CEE9; Mon, 28 Oct 2024 11:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730113466; bh=+KsPW+UwOATIiva30fDwDf9YFBwdccBWJBjRe5rPAXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r/YzKaXp5ZniTTVhekTO+z9R25IY0+OBzDMQRxKeA3Ehy3ZzY31YM6ADroHlBtKVn cEjWMgnWP6LUCWYyIyP60PspdRN8H9vqBs6PRiwk3Y5ef4D5BUxwOwbTzYiH5s7ZQ2 YZzsk0PjmuIEVeeHYfL0EMud5sonoBpQlPqPkFjbROdYVGN5SuGX+rMwBKm++k9ygB l3eIE2Ncn9QOkPyiHX7XUyfqXg9gIZYyHv6hk2op6IoD3kCCIGLTuWMOs8Uvvl+lom sb1QYRp4UknwZ9kapk7EabQglfdIKOve6EJnIhVDZWaC0afJ78XzNYMvbSYtOpANYu PjNeeHOXtv2kA== Received: by pali.im (Postfix) id B9FC4C7B; Mon, 28 Oct 2024 12:04:18 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Steve French , Paulo Alcantara , Ronnie Sahlberg Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] cifs: Fix parsing reparse point with native symlink in SMB1 non-UNICODE session Date: Mon, 28 Oct 2024 12:03:39 +0100 Message-Id: <20241028110340.29911-5-pali@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241028110340.29911-1-pali@kernel.org> References: <20241028110340.29911-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SMB1 NT_TRANSACT_IOCTL/FSCTL_GET_REPARSE_POINT even in non-UNICODE mode returns reparse buffer in UNICODE/UTF-16 format. This is because FSCTL_GET_REPARSE_POINT is NT-based IOCTL which does not distinguish between 8-bit non-UNICODE and 16-bit UNICODE modes and its path buffers are always encoded in UTF-16. This change fixes reading of native symlinks in SMB1 when UNICODE session is not active. Fixes: ed3e0a149b58 ("smb: client: implement ->query_reparse_point() for SMB1") Signed-off-by: Pali Rohár --- fs/smb/client/smb1ops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/smb/client/smb1ops.c b/fs/smb/client/smb1ops.c index b0fb4a5c586d..f552951cfc04 100644 --- a/fs/smb/client/smb1ops.c +++ b/fs/smb/client/smb1ops.c @@ -1000,12 +1000,11 @@ static int cifs_parse_reparse_point(struct cifs_sb_info *cifs_sb, { struct reparse_data_buffer *buf; TRANSACT_IOCTL_RSP *io = rsp_iov->iov_base; - bool unicode = !!(io->hdr.Flags2 & SMBFLG2_UNICODE); u32 plen = le16_to_cpu(io->ByteCount); buf = (struct reparse_data_buffer *)((__u8 *)&io->hdr.Protocol + le32_to_cpu(io->DataOffset)); - return parse_reparse_point(buf, plen, cifs_sb, full_path, unicode, data); + return parse_reparse_point(buf, plen, cifs_sb, full_path, true, data); } static bool From patchwork Mon Oct 28 11:03:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 13853309 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D4FD1DE3A5; Mon, 28 Oct 2024 11:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; cv=none; b=a+P6UTGP8HA30brzclWO3MhWyG0cN7xJebeeSF8t7CMmSAu+nLel30/k7P+kcFLFidz0Z4rjfkt+cvzYomFuLoWNo6q4Y3AM6fUtEqgdM2wFk+bWblMETWg9XqDdV4o1RBDxp0I3xC19gg1QgDRnS/4ppcmv8B8LUVOX5mMjWFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730113466; c=relaxed/simple; bh=DSYo+AMOz9V76UAeqSyE83YB2PapFnpd3VyO1UD2pp0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Trn4AQu9e7VRsE2GxBsGjRc6NZ0727b6DIfuLkwQ4gt2BjOkr2R5kq7AS5+BaXttwE5s23ahAwBF9jSj4NrDnCHb2wPFmKG68OxPK8NnH59hk+zVSuorMAh11X3Q8xkzEvzUFq0nABMyg6bHr6UjLPCT3TP3ApOIQfGrH88QRJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=If6dcUvX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="If6dcUvX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC0E7C4CEE8; Mon, 28 Oct 2024 11:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730113466; bh=DSYo+AMOz9V76UAeqSyE83YB2PapFnpd3VyO1UD2pp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=If6dcUvXcpr9DbEotD3tkvORgL/EMBq6sDBfGuIkicUczKXxXiwLGrVENDJ9nqQtR o4GtNOA9MyCRuvxjZvhvSfpT7ZmAMeNQFvNYOoIs8jtJH4mgQ349iA+UaqFQFqA/I2 TDG4RiPUsgW+6fs9wEctQ5b3DzBbiVXwkxvcW93YTtOceWb9La24vxVCuVvKUnfkqW 9SeTF6VrP6ZoEe8uRGym+E1CD3dxQhw1sBXokvxz0WF82gXKpTkEOtFYc6wBlJpgZO P9X0PNK1Dl7b9njoF7bbaPtDEBpS80CBNAsPw1h05acL9tlBvDK80gmwxciDTldnJC gp+AwpY9L418A== Received: by pali.im (Postfix) id 02ACADEC; Mon, 28 Oct 2024 12:04:19 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Steve French , Paulo Alcantara , Ronnie Sahlberg Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] cifs: Remove unicode parameter from parse_reparse_point() function Date: Mon, 28 Oct 2024 12:03:40 +0100 Message-Id: <20241028110340.29911-6-pali@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241028110340.29911-1-pali@kernel.org> References: <20241028110340.29911-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This parameter is always true, so remove it and also remove dead code which is never called (for all false code paths). Signed-off-by: Pali Rohár --- fs/smb/client/cifsproto.h | 2 +- fs/smb/client/reparse.c | 25 +++++++++++-------------- fs/smb/client/smb1ops.c | 2 +- fs/smb/client/smb2file.c | 1 - fs/smb/client/smb2proto.h | 2 +- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h index a7906c193647..31445d40f179 100644 --- a/fs/smb/client/cifsproto.h +++ b/fs/smb/client/cifsproto.h @@ -667,7 +667,7 @@ char *extract_sharename(const char *unc); int parse_reparse_point(struct reparse_data_buffer *buf, u32 plen, struct cifs_sb_info *cifs_sb, const char *full_path, - bool unicode, struct cifs_open_info_data *data); + struct cifs_open_info_data *data); int __cifs_sfu_make_node(unsigned int xid, struct inode *inode, struct dentry *dentry, struct cifs_tcon *tcon, const char *full_path, umode_t mode, dev_t dev, diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c index 3de91331c96c..50720142813e 100644 --- a/fs/smb/client/reparse.c +++ b/fs/smb/client/reparse.c @@ -775,7 +775,7 @@ static int parse_reparse_posix(struct reparse_posix_data *buf, } int smb2_parse_native_symlink(char **target, const char *buf, unsigned int len, - bool unicode, bool relative, + bool relative, const char *full_path, struct cifs_sb_info *cifs_sb) { @@ -789,26 +789,24 @@ int smb2_parse_native_symlink(char **target, const char *buf, unsigned int len, int rc; int i; - /* Check that length it valid for unicode/non-unicode mode */ - if (!len || (unicode && (len % 2))) { + /* Check that length it valid */ + if (!len || (len % 2)) { cifs_dbg(VFS, "srv returned malformed symlink buffer\n"); rc = -EIO; goto out; } /* - * Check that buffer does not contain UTF-16 null codepoint in unicode - * mode or null byte in non-unicode mode because Linux cannot process - * symlink with null byte. + * Check that buffer does not contain UTF-16 null codepoint + * because Linux cannot process symlink with null byte. */ - if ((unicode && UniStrnlen((wchar_t *)buf, len/2) != len/2) || - (!unicode && strnlen(buf, len) != len)) { + if (UniStrnlen((wchar_t *)buf, len/2) != len/2) { cifs_dbg(VFS, "srv returned null byte in native symlink target location\n"); rc = -EIO; goto out; } - smb_target = cifs_strndup_from_utf16(buf, len, unicode, cifs_sb->local_nls); + smb_target = cifs_strndup_from_utf16(buf, len, true, cifs_sb->local_nls); if (!smb_target) { rc = -ENOMEM; goto out; @@ -985,7 +983,7 @@ int smb2_parse_native_symlink(char **target, const char *buf, unsigned int len, } static int parse_reparse_native_symlink(struct reparse_symlink_data_buffer *sym, - u32 plen, bool unicode, + u32 plen, struct cifs_sb_info *cifs_sb, const char *full_path, struct cifs_open_info_data *data) @@ -1005,7 +1003,6 @@ static int parse_reparse_native_symlink(struct reparse_symlink_data_buffer *sym, return smb2_parse_native_symlink(&data->symlink_target, sym->PathBuffer + offs, len, - unicode, le32_to_cpu(sym->Flags) & SYMLINK_FLAG_RELATIVE, full_path, cifs_sb); @@ -1060,7 +1057,7 @@ static int parse_reparse_wsl_symlink(struct reparse_wsl_symlink_data_buffer *buf int parse_reparse_point(struct reparse_data_buffer *buf, u32 plen, struct cifs_sb_info *cifs_sb, const char *full_path, - bool unicode, struct cifs_open_info_data *data) + struct cifs_open_info_data *data) { struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); @@ -1074,7 +1071,7 @@ int parse_reparse_point(struct reparse_data_buffer *buf, case IO_REPARSE_TAG_SYMLINK: return parse_reparse_native_symlink( (struct reparse_symlink_data_buffer *)buf, - plen, unicode, cifs_sb, full_path, data); + plen, cifs_sb, full_path, data); case IO_REPARSE_TAG_LX_SYMLINK: return parse_reparse_wsl_symlink( (struct reparse_wsl_symlink_data_buffer *)buf, @@ -1108,7 +1105,7 @@ int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb, buf = (struct reparse_data_buffer *)((u8 *)io + le32_to_cpu(io->OutputOffset)); - return parse_reparse_point(buf, plen, cifs_sb, full_path, true, data); + return parse_reparse_point(buf, plen, cifs_sb, full_path, data); } static void wsl_to_fattr(struct cifs_open_info_data *data, diff --git a/fs/smb/client/smb1ops.c b/fs/smb/client/smb1ops.c index f552951cfc04..3667fb94cbf5 100644 --- a/fs/smb/client/smb1ops.c +++ b/fs/smb/client/smb1ops.c @@ -1004,7 +1004,7 @@ static int cifs_parse_reparse_point(struct cifs_sb_info *cifs_sb, buf = (struct reparse_data_buffer *)((__u8 *)&io->hdr.Protocol + le32_to_cpu(io->DataOffset)); - return parse_reparse_point(buf, plen, cifs_sb, full_path, true, data); + return parse_reparse_point(buf, plen, cifs_sb, full_path, data); } static bool diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c index 91b8d00fb88e..b0037058e8d9 100644 --- a/fs/smb/client/smb2file.c +++ b/fs/smb/client/smb2file.c @@ -132,7 +132,6 @@ int smb2_parse_symlink_response(struct cifs_sb_info *cifs_sb, const struct kvec return smb2_parse_native_symlink(path, (char *)sym->PathBuffer + sub_offs, sub_len, - true, le32_to_cpu(sym->Flags) & SYMLINK_FLAG_RELATIVE, full_path, cifs_sb); diff --git a/fs/smb/client/smb2proto.h b/fs/smb/client/smb2proto.h index 5390d5a61039..c62493c0afc7 100644 --- a/fs/smb/client/smb2proto.h +++ b/fs/smb/client/smb2proto.h @@ -115,7 +115,7 @@ extern int smb3_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, unsigned int *pbytes_read); int smb2_fix_symlink_target_type(char **target, bool directory, struct cifs_sb_info *cifs_sb); int smb2_parse_native_symlink(char **target, const char *buf, unsigned int len, - bool unicode, bool relative, + bool relative, const char *full_path, struct cifs_sb_info *cifs_sb); int smb2_parse_symlink_response(struct cifs_sb_info *cifs_sb,