All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, NeilBrown <neilb@suse.de>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <Anna.Schumaker@Netapp.com>
Cc: lkp@intel.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH/rfc] NFS: introduce NFS namespaces.
Date: Fri, 25 Jun 2021 16:37:52 +0300	[thread overview]
Message-ID: <202106252106.UEbAG2Yp-lkp@intel.com> (raw)
In-Reply-To: <162458475606.28671.1835069742861755259@noble.neil.brown.name>

Hi NeilBrown,

url:    https://github.com/0day-ci/linux/commits/NeilBrown/NFS-introduce-NFS-namespaces/20210625-093359
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: x86_64-randconfig-m001-20210622 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
fs/nfs/nfs4proc.c:6270 nfs4_init_uniform_client_string() error: we previously assumed 'clp->cl_namespace' could be null (see line 6247)

Old smatch warnings:
fs/nfs/nfs4proc.c:1382 nfs4_opendata_alloc() error: we previously assumed 'c' could be null (see line 1350)

vim +6270 fs/nfs/nfs4proc.c

873e385116b2cc Jeff Layton     2015-06-09  6234  static int
873e385116b2cc Jeff Layton     2015-06-09  6235  nfs4_init_uniform_client_string(struct nfs_client *clp)
873e385116b2cc Jeff Layton     2015-06-09  6236  {
1aee551334cda1 Trond Myklebust 2020-10-07  6237  	char buf[NFS4_CLIENT_ID_UNIQ_LEN];
1aee551334cda1 Trond Myklebust 2020-10-07  6238  	size_t buflen;
873e385116b2cc Jeff Layton     2015-06-09  6239  	size_t len;
873e385116b2cc Jeff Layton     2015-06-09  6240  	char *str;
ceb3a16c070c40 Trond Myklebust 2015-01-03  6241  
ceb3a16c070c40 Trond Myklebust 2015-01-03  6242  	if (clp->cl_owner_id != NULL)
873e385116b2cc Jeff Layton     2015-06-09  6243  		return 0;
6f2ea7f2a3ff3c Chuck Lever     2012-09-14  6244  
873e385116b2cc Jeff Layton     2015-06-09  6245  	len = 10 + 10 + 1 + 10 + 1 +
873e385116b2cc Jeff Layton     2015-06-09  6246  		strlen(clp->cl_rpcclient->cl_nodename) + 1;
0575ca34891617 NeilBrown       2021-06-25 @6247  	if (clp->cl_namespace)
                                                        ^^^^^^^^^^^^^^^^^^^^^^
Checks for NULL

0575ca34891617 NeilBrown       2021-06-25  6248  		len += strlen(clp->cl_namespace) + 1;
873e385116b2cc Jeff Layton     2015-06-09  6249  
39d43d164127da Trond Myklebust 2020-10-07  6250  	buflen = nfs4_get_uniquifier(clp, buf, sizeof(buf));
1aee551334cda1 Trond Myklebust 2020-10-07  6251  	if (buflen)
1aee551334cda1 Trond Myklebust 2020-10-07  6252  		len += buflen + 1;
1aee551334cda1 Trond Myklebust 2020-10-07  6253  
873e385116b2cc Jeff Layton     2015-06-09  6254  	if (len > NFS4_OPAQUE_LIMIT + 1)
873e385116b2cc Jeff Layton     2015-06-09  6255  		return -EINVAL;
873e385116b2cc Jeff Layton     2015-06-09  6256  
873e385116b2cc Jeff Layton     2015-06-09  6257  	/*
873e385116b2cc Jeff Layton     2015-06-09  6258  	 * Since this string is allocated at mount time, and held until the
873e385116b2cc Jeff Layton     2015-06-09  6259  	 * nfs_client is destroyed, we can use GFP_KERNEL here w/o worrying
873e385116b2cc Jeff Layton     2015-06-09  6260  	 * about a memory-reclaim deadlock.
873e385116b2cc Jeff Layton     2015-06-09  6261  	 */
873e385116b2cc Jeff Layton     2015-06-09  6262  	str = kmalloc(len, GFP_KERNEL);
873e385116b2cc Jeff Layton     2015-06-09  6263  	if (!str)
873e385116b2cc Jeff Layton     2015-06-09  6264  		return -ENOMEM;
873e385116b2cc Jeff Layton     2015-06-09  6265  
1aee551334cda1 Trond Myklebust 2020-10-07  6266  	if (buflen)
0575ca34891617 NeilBrown       2021-06-25  6267  		scnprintf(str, len, "Linux NFSv%u.%u %s/%s%s%s",
1aee551334cda1 Trond Myklebust 2020-10-07  6268  			  clp->rpc_ops->version, clp->cl_minorversion,
0575ca34891617 NeilBrown       2021-06-25  6269  			  buf, clp->cl_rpcclient->cl_nodename,
0575ca34891617 NeilBrown       2021-06-25 @6270  			  *clp->cl_namespace ? "/" : "",
                                                                          ^^^^^^^^^^^^^^^^^^
Unchecked dereference

0575ca34891617 NeilBrown       2021-06-25  6271  			  clp->cl_namespace);
1aee551334cda1 Trond Myklebust 2020-10-07  6272  	else
0575ca34891617 NeilBrown       2021-06-25  6273  		scnprintf(str, len, "Linux NFSv%u.%u %s%s%s",
e984a55a7418f7 Chuck Lever     2012-09-14  6274  			  clp->rpc_ops->version, clp->cl_minorversion,
0575ca34891617 NeilBrown       2021-06-25  6275  			  clp->cl_rpcclient->cl_nodename,
0575ca34891617 NeilBrown       2021-06-25  6276  			  *clp->cl_namespace ? "/" : "",
                                                                          ^^^^^^^^^^^^^^^^^^
Unchecked dereference

0575ca34891617 NeilBrown       2021-06-25  6277  			  clp->cl_namespace);
873e385116b2cc Jeff Layton     2015-06-09  6278  	clp->cl_owner_id = str;
873e385116b2cc Jeff Layton     2015-06-09  6279  	return 0;
e984a55a7418f7 Chuck Lever     2012-09-14  6280  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH/rfc] NFS: introduce NFS namespaces.
Date: Fri, 25 Jun 2021 21:07:22 +0800	[thread overview]
Message-ID: <202106252106.UEbAG2Yp-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 5315 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <162458475606.28671.1835069742861755259@noble.neil.brown.name>
References: <162458475606.28671.1835069742861755259@noble.neil.brown.name>
TO: NeilBrown <neilb@suse.de>
TO: Trond Myklebust <trond.myklebust@hammerspace.com>
TO: Anna Schumaker <Anna.Schumaker@Netapp.com>
CC: linux-nfs(a)vger.kernel.org

Hi NeilBrown,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on nfs/linux-next]
[also build test WARNING on v5.13-rc7 next-20210624]
[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]

url:    https://github.com/0day-ci/linux/commits/NeilBrown/NFS-introduce-NFS-namespaces/20210625-093359
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
:::::: branch date: 12 hours ago
:::::: commit date: 12 hours ago
config: x86_64-randconfig-m001-20210622 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
fs/nfs/nfs4proc.c:6270 nfs4_init_uniform_client_string() error: we previously assumed 'clp->cl_namespace' could be null (see line 6247)

Old smatch warnings:
fs/nfs/nfs4proc.c:1382 nfs4_opendata_alloc() error: we previously assumed 'c' could be null (see line 1350)

vim +6270 fs/nfs/nfs4proc.c

e984a55a7418f7 Chuck Lever     2012-09-14  6233  
873e385116b2cc Jeff Layton     2015-06-09  6234  static int
873e385116b2cc Jeff Layton     2015-06-09  6235  nfs4_init_uniform_client_string(struct nfs_client *clp)
873e385116b2cc Jeff Layton     2015-06-09  6236  {
1aee551334cda1 Trond Myklebust 2020-10-07  6237  	char buf[NFS4_CLIENT_ID_UNIQ_LEN];
1aee551334cda1 Trond Myklebust 2020-10-07  6238  	size_t buflen;
873e385116b2cc Jeff Layton     2015-06-09  6239  	size_t len;
873e385116b2cc Jeff Layton     2015-06-09  6240  	char *str;
ceb3a16c070c40 Trond Myklebust 2015-01-03  6241  
ceb3a16c070c40 Trond Myklebust 2015-01-03  6242  	if (clp->cl_owner_id != NULL)
873e385116b2cc Jeff Layton     2015-06-09  6243  		return 0;
6f2ea7f2a3ff3c Chuck Lever     2012-09-14  6244  
873e385116b2cc Jeff Layton     2015-06-09  6245  	len = 10 + 10 + 1 + 10 + 1 +
873e385116b2cc Jeff Layton     2015-06-09  6246  		strlen(clp->cl_rpcclient->cl_nodename) + 1;
0575ca34891617 NeilBrown       2021-06-25 @6247  	if (clp->cl_namespace)
0575ca34891617 NeilBrown       2021-06-25  6248  		len += strlen(clp->cl_namespace) + 1;
873e385116b2cc Jeff Layton     2015-06-09  6249  
39d43d164127da Trond Myklebust 2020-10-07  6250  	buflen = nfs4_get_uniquifier(clp, buf, sizeof(buf));
1aee551334cda1 Trond Myklebust 2020-10-07  6251  	if (buflen)
1aee551334cda1 Trond Myklebust 2020-10-07  6252  		len += buflen + 1;
1aee551334cda1 Trond Myklebust 2020-10-07  6253  
873e385116b2cc Jeff Layton     2015-06-09  6254  	if (len > NFS4_OPAQUE_LIMIT + 1)
873e385116b2cc Jeff Layton     2015-06-09  6255  		return -EINVAL;
873e385116b2cc Jeff Layton     2015-06-09  6256  
873e385116b2cc Jeff Layton     2015-06-09  6257  	/*
873e385116b2cc Jeff Layton     2015-06-09  6258  	 * Since this string is allocated at mount time, and held until the
873e385116b2cc Jeff Layton     2015-06-09  6259  	 * nfs_client is destroyed, we can use GFP_KERNEL here w/o worrying
873e385116b2cc Jeff Layton     2015-06-09  6260  	 * about a memory-reclaim deadlock.
873e385116b2cc Jeff Layton     2015-06-09  6261  	 */
873e385116b2cc Jeff Layton     2015-06-09  6262  	str = kmalloc(len, GFP_KERNEL);
873e385116b2cc Jeff Layton     2015-06-09  6263  	if (!str)
873e385116b2cc Jeff Layton     2015-06-09  6264  		return -ENOMEM;
873e385116b2cc Jeff Layton     2015-06-09  6265  
1aee551334cda1 Trond Myklebust 2020-10-07  6266  	if (buflen)
0575ca34891617 NeilBrown       2021-06-25  6267  		scnprintf(str, len, "Linux NFSv%u.%u %s/%s%s%s",
1aee551334cda1 Trond Myklebust 2020-10-07  6268  			  clp->rpc_ops->version, clp->cl_minorversion,
0575ca34891617 NeilBrown       2021-06-25  6269  			  buf, clp->cl_rpcclient->cl_nodename,
0575ca34891617 NeilBrown       2021-06-25 @6270  			  *clp->cl_namespace ? "/" : "",
0575ca34891617 NeilBrown       2021-06-25  6271  			  clp->cl_namespace);
1aee551334cda1 Trond Myklebust 2020-10-07  6272  	else
0575ca34891617 NeilBrown       2021-06-25  6273  		scnprintf(str, len, "Linux NFSv%u.%u %s%s%s",
e984a55a7418f7 Chuck Lever     2012-09-14  6274  			  clp->rpc_ops->version, clp->cl_minorversion,
0575ca34891617 NeilBrown       2021-06-25  6275  			  clp->cl_rpcclient->cl_nodename,
0575ca34891617 NeilBrown       2021-06-25  6276  			  *clp->cl_namespace ? "/" : "",
0575ca34891617 NeilBrown       2021-06-25  6277  			  clp->cl_namespace);
873e385116b2cc Jeff Layton     2015-06-09  6278  	clp->cl_owner_id = str;
873e385116b2cc Jeff Layton     2015-06-09  6279  	return 0;
e984a55a7418f7 Chuck Lever     2012-09-14  6280  }
e984a55a7418f7 Chuck Lever     2012-09-14  6281  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 50285 bytes --]

  reply	other threads:[~2021-06-25 13:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  1:32 [PATCH/rfc] NFS: introduce NFS namespaces NeilBrown
2021-06-25 13:07 ` kernel test robot [this message]
2021-06-25 13:37   ` Dan Carpenter
2021-06-28  0:14   ` NeilBrown
2021-06-28  6:35     ` Dan Carpenter
2021-06-28  6:35       ` Dan Carpenter
2021-07-01  0:54 ` [PATCH/rfc v2] " NeilBrown
2021-07-01  9:32   ` Daire Byrne
2021-07-01 11:39     ` NeilBrown
2021-07-03 12:45       ` Daire Byrne
2021-07-03 23:03         ` NeilBrown
2021-07-06 16:22           ` Daire Byrne
2021-07-07  1:12             ` NeilBrown
2021-07-07 10:57               ` Daire Byrne
2021-07-07 21:25                 ` NeilBrown
2021-07-07 22:21                   ` Daire Byrne
2021-07-07 23:18                     ` NeilBrown
2021-07-13 12:27                       ` Daire Byrne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202106252106.UEbAG2Yp-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=kbuild@lists.01.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=neilb@suse.de \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.