All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] smb: client: convert DFS target node name from cache charset on mount
@ 2026-11-22 13:05 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2026-11-22 13:05 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "too many reports for this commit"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20261122045841.99012-1-fredric.cover.lkernel@gmail.com>
References: <20261122045841.99012-1-fredric.cover.lkernel@gmail.com>
TO: Fredric Cover <fredric.cover.lkernel@gmail.com>
TO: Paulo Alcantara <pc@manguebit.org>
TO: Namjae Jeon <linkinjeon@kernel.org>
CC: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
CC: Tom Talpey <tom@talpey.com>
CC: Ronnie Sahlberg <ronniesahlberg@gmail.com>
CC: Shyam Prasad N <sprasad@microsoft.com>
CC: Bharath SM <bharathsm@microsoft.com>
CC: linux-cifs@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: Fredric Cover <fredric.cover.lkernel@gmail.com>
CC: stable@vger.kernel.org

Hi Fredric,

kernel test robot noticed the following build errors:

[auto build test ERROR on manguebit/cifs-next]
[also build test ERROR on manguebit/cifs-fixes linus/master v7.4-rc3 next-20261120]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Fredric-Cover/smb-client-convert-DFS-target-node-name-from-cache-charset-on-mount/20261122-045840
base:   https://git.manguebit.org/linux.git cifs-next
patch link:    https://lore.kernel.org/r/20261122045841.99012-1-fredric.cover.lkernel%40gmail.com
patch subject: [PATCH] smb: client: convert DFS target node name from cache charset on mount
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20261122/202611222108.7GCO1GPZ-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261122/202611222108.7GCO1GPZ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202611222108.7GCO1GPZ-lkp@intel.com/

All errors (new ones prefixed by >>):

   fs/smb/client/dfs.c: In function 'dfs_parse_target_referral':
>> fs/smb/client/dfs.c:44:21: error: implicit declaration of function 'dfs_cache_local_path'; did you mean 'dfs_cache_canonical_path'? [-Wimplicit-function-declaration]
      44 |         node_name = dfs_cache_local_path(ref->node_name, ctx->local_nls);
         |                     ^~~~~~~~~~~~~~~~~~~~
         |                     dfs_cache_canonical_path
>> fs/smb/client/dfs.c:44:19: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      44 |         node_name = dfs_cache_local_path(ref->node_name, ctx->local_nls);
         |                   ^


vim +44 fs/smb/client/dfs.c

ad46faff1afcc8d fs/smb/client/dfs.c Paulo Alcantara 2025-01-03  13  
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  14  /**
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  15   * dfs_parse_target_referral - set fs context for dfs target referral
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  16   *
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  17   * @full_path: full path in UNC format.
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  18   * @ref: dfs referral pointer.
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  19   * @ctx: smb3 fs context pointer.
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  20   *
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  21   * Return zero if dfs referral was parsed correctly, otherwise non-zero.
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  22   */
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  23  int dfs_parse_target_referral(const char *full_path, const struct dfs_info3_param *ref,
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  24  			      struct smb3_fs_context *ctx)
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  25  {
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  26  	int rc;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  27  	const char *prepath = NULL;
431f71072745dae fs/smb/client/dfs.c Fredric Cover   2026-11-22  28  	char *node_name = NULL;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  29  	char *path;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  30  
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  31  	if (!full_path || !*full_path || !ref || !ctx)
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  32  		return -EINVAL;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  33  
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  34  	if (WARN_ON_ONCE(!ref->node_name || ref->path_consumed < 0))
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  35  		return -EINVAL;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  36  
86aacc2f3f6ba18 fs/smb/client/dfs.c Fredric Cover   2026-11-07  37  	if ((size_t)ref->path_consumed < strlen(full_path)) {
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  38  		prepath = full_path + ref->path_consumed;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  39  		/* skip initial delimiter */
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  40  		if (*prepath == '/' || *prepath == '\\')
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  41  			prepath++;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  42  	}
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  43  
431f71072745dae fs/smb/client/dfs.c Fredric Cover   2026-11-22 @44  	node_name = dfs_cache_local_path(ref->node_name, ctx->local_nls);
431f71072745dae fs/smb/client/dfs.c Fredric Cover   2026-11-22  45  	if (IS_ERR(node_name))
431f71072745dae fs/smb/client/dfs.c Fredric Cover   2026-11-22  46  		return PTR_ERR(node_name);
431f71072745dae fs/smb/client/dfs.c Fredric Cover   2026-11-22  47  
431f71072745dae fs/smb/client/dfs.c Fredric Cover   2026-11-22  48  	path = cifs_build_devname(node_name, prepath);
431f71072745dae fs/smb/client/dfs.c Fredric Cover   2026-11-22  49  	kfree(node_name);
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  50  	if (IS_ERR(path))
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  51  		return PTR_ERR(path);
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  52  
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  53  	rc = smb3_parse_devname(path, ctx);
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  54  	if (rc)
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  55  		goto out;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  56  
4b1b4c8be9dee9a fs/smb/client/dfs.c Paulo Alcantara 2025-01-07  57  	rc = dns_resolve_unc(DFS_DOM(ctx), path,
4b1b4c8be9dee9a fs/smb/client/dfs.c Paulo Alcantara 2025-01-07  58  			     (struct sockaddr *)&ctx->dstaddr);
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  59  out:
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  60  	kfree(path);
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  61  	return rc;
abdb1742a312388 fs/cifs/dfs.c       Paulo Alcantara 2022-10-04  62  }
a1c0d00572fca4a fs/cifs/dfs.c       Paulo Alcantara 2022-11-17  63  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] smb: client: convert DFS target node name from cache charset on mount
@ 2026-11-22  4:58 Fredric Cover
  2026-11-22 10:54 ` kernel test robot
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Fredric Cover @ 2026-11-22  4:58 UTC (permalink / raw)
  To: Paulo Alcantara, Namjae Jeon
  Cc: ChenXiaoSong, Tom Talpey, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, linux-cifs, linux-kernel, Fredric Cover, stable

parse_dfs_target() converts @path_consumed to the mount charset using
dfs_consumed_to_local(), but @ref->node_name from the DFS referral cache
is still encoded in UTF-8 (cache_cp).

In dfs_parse_target_referral(), passing @ref->node_name directly to
cifs_build_devname() and smb3_parse_devname() copies UTF-8 bytes into
ctx->UNC and ctx->prepath (and mixes encodings when @prepath from
@full_path is also non-empty). On mounts using a non-UTF-8 iocharset
such as iso8859-1, subsequent path checks re-encode these strings to
UTF-16LE using local_nls, corrupting non-ASCII characters on the wire
and causing initial mount to fail with -ENOENT.

Convert @ref->node_name from cache_cp to ctx->local_nls with
dfs_cache_local_path() before building the device name so ctx->UNC and
ctx->prepath stay in the mount charset.

Tested against Samba with iocharset=iso8859-1 and iocharset=utf8 for
both DFS link referrals with a non-ASCII target subpath and mounts with
an additional non-ASCII prepath, including reconnects.

Fixes: c870a8e70e68 ("cifs: handle different charsets in dfs cache")
Cc: stable@vger.kernel.org # depends on: smb: client: convert DFS prefix from cache charset on reconnect
Signed-off-by: Fredric Cover <fredric.cover.lkernel@gmail.com>
---
Note: Applies on top of "smb: client: convert DFS prefix from cache charset on reconnect".
---
 fs/smb/client/dfs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/smb/client/dfs.c b/fs/smb/client/dfs.c
index efef00c33321..6b212e49cf92 100644
--- a/fs/smb/client/dfs.c
+++ b/fs/smb/client/dfs.c
@@ -25,6 +25,7 @@ int dfs_parse_target_referral(const char *full_path, const struct dfs_info3_para
 {
 	int rc;
 	const char *prepath = NULL;
+	char *node_name = NULL;
 	char *path;
 
 	if (!full_path || !*full_path || !ref || !ctx)
@@ -40,7 +41,12 @@ int dfs_parse_target_referral(const char *full_path, const struct dfs_info3_para
 			prepath++;
 	}
 
-	path = cifs_build_devname(ref->node_name, prepath);
+	node_name = dfs_cache_local_path(ref->node_name, ctx->local_nls);
+	if (IS_ERR(node_name))
+		return PTR_ERR(node_name);
+
+	path = cifs_build_devname(node_name, prepath);
+	kfree(node_name);
 	if (IS_ERR(path))
 		return PTR_ERR(path);
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-26 12:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 13:05 [PATCH] smb: client: convert DFS target node name from cache charset on mount kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-11-22  4:58 Fredric Cover
2026-11-22 10:54 ` kernel test robot
2026-11-22 11:07 ` kernel test robot
2026-11-22 11:50 ` kernel test robot
2026-11-22 16:24   ` Fredric Cover
2026-11-26 12:15 ` Paulo Alcantara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.