From: kernel test robot <lkp@intel.com>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
Namjae Jeon <namjae.jeon@samsung.com>,
Steve French <stfrench@microsoft.com>
Subject: [smfrench-smb3-kernel:pr/65 143/143] fs/ksmbd/smb2pdu.c:5640:6: warning: variable 'user_ns' is used uninitialized whenever 'if' condition is true
Date: Wed, 25 Aug 2021 15:14:01 +0800 [thread overview]
Message-ID: <202108251550.SXFHPzdJ-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6713 bytes --]
tree: git://github.com/smfrench/smb3-kernel.git pr/65
head: 4b499755e1024f97e75411920a404b357af6e153
commit: 4b499755e1024f97e75411920a404b357af6e153 [143/143] ksmbd: fix lookup on idmapped mounts
config: hexagon-randconfig-r041-20210824 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d26000e4cc2bc65e207a84fa26cb6e374d60aa12)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/smfrench/smb3-kernel/commit/4b499755e1024f97e75411920a404b357af6e153
git remote add smfrench-smb3-kernel git://github.com/smfrench/smb3-kernel.git
git fetch --no-tags smfrench-smb3-kernel pr/65
git checkout 4b499755e1024f97e75411920a404b357af6e153
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/ksmbd/smb2pdu.c:3546:10: error: implicit declaration of function 'lookup_one' [-Werror,-Wimplicit-function-declaration]
dent = lookup_one(user_ns, priv->d_info->name,
^
fs/ksmbd/smb2pdu.c:3546:8: warning: incompatible integer to pointer conversion assigning to 'struct dentry *' from 'int' [-Wint-conversion]
dent = lookup_one(user_ns, priv->d_info->name,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/ksmbd/smb2pdu.c:5640:6: warning: variable 'user_ns' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (ksmbd_stream_fd(fp))
^~~~~~~~~~~~~~~~~~~
fs/ksmbd/smb2pdu.c:5662:31: note: uninitialized use occurs here
return smb2_rename(work, fp, user_ns,
^~~~~~~
fs/ksmbd/smb2pdu.c:5640:2: note: remove the 'if' if its condition is always false
if (ksmbd_stream_fd(fp))
^~~~~~~~~~~~~~~~~~~~~~~~
fs/ksmbd/smb2pdu.c:5629:32: note: initialize the variable 'user_ns' to silence this warning
struct user_namespace *user_ns;
^
= NULL
2 warnings and 1 error generated.
vim +5640 fs/ksmbd/smb2pdu.c
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5625
64b39f4a2fd293 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-30 5626 static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp,
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5627 char *buf)
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5628 {
4b499755e1024f fs/ksmbd/smb2pdu.c Christian Brauner 2021-08-16 5629 struct user_namespace *user_ns;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5630 struct ksmbd_file *parent_fp;
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5631 struct dentry *parent;
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5632 struct dentry *dentry = fp->filp->f_path.dentry;
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5633 int ret;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5634
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5635 if (!(fp->daccess & FILE_DELETE_LE)) {
bde1694aecdb53 fs/cifsd/smb2pdu.c Namjae Jeon 2021-06-28 5636 pr_err("no right to delete : 0x%x\n", fp->daccess);
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5637 return -EACCES;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5638 }
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5639
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 @5640 if (ksmbd_stream_fd(fp))
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5641 goto next;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5642
4b499755e1024f fs/ksmbd/smb2pdu.c Christian Brauner 2021-08-16 5643 user_ns = file_mnt_user_ns(fp->filp);
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5644 parent = dget_parent(dentry);
4b499755e1024f fs/ksmbd/smb2pdu.c Christian Brauner 2021-08-16 5645 ret = ksmbd_vfs_lock_parent(user_ns, parent, dentry);
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5646 if (ret) {
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5647 dput(parent);
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5648 return ret;
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5649 }
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5650
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5651 parent_fp = ksmbd_lookup_fd_inode(d_inode(parent));
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5652 inode_unlock(d_inode(parent));
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5653 dput(parent);
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5654
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5655 if (parent_fp) {
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5656 if (parent_fp->daccess & FILE_DELETE_LE) {
bde1694aecdb53 fs/cifsd/smb2pdu.c Namjae Jeon 2021-06-28 5657 pr_err("parent dir is opened with delete access\n");
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5658 return -ESHARE;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5659 }
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5660 }
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5661 next:
4b499755e1024f fs/ksmbd/smb2pdu.c Christian Brauner 2021-08-16 5662 return smb2_rename(work, fp, user_ns,
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5663 (struct smb2_file_rename_info *)buf,
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5664 work->sess->conn->local_nls);
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5665 }
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5666
:::::: The code at line 5640 was first introduced by commit
:::::: e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 cifsd: add server-side procedures for SMB3
:::::: TO: Namjae Jeon <namjae.jeon@samsung.com>
:::::: CC: Steve French <stfrench@microsoft.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25870 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [smfrench-smb3-kernel:pr/65 143/143] fs/ksmbd/smb2pdu.c:5640:6: warning: variable 'user_ns' is used uninitialized whenever 'if' condition is true
Date: Wed, 25 Aug 2021 15:14:01 +0800 [thread overview]
Message-ID: <202108251550.SXFHPzdJ-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6811 bytes --]
tree: git://github.com/smfrench/smb3-kernel.git pr/65
head: 4b499755e1024f97e75411920a404b357af6e153
commit: 4b499755e1024f97e75411920a404b357af6e153 [143/143] ksmbd: fix lookup on idmapped mounts
config: hexagon-randconfig-r041-20210824 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d26000e4cc2bc65e207a84fa26cb6e374d60aa12)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/smfrench/smb3-kernel/commit/4b499755e1024f97e75411920a404b357af6e153
git remote add smfrench-smb3-kernel git://github.com/smfrench/smb3-kernel.git
git fetch --no-tags smfrench-smb3-kernel pr/65
git checkout 4b499755e1024f97e75411920a404b357af6e153
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/ksmbd/smb2pdu.c:3546:10: error: implicit declaration of function 'lookup_one' [-Werror,-Wimplicit-function-declaration]
dent = lookup_one(user_ns, priv->d_info->name,
^
fs/ksmbd/smb2pdu.c:3546:8: warning: incompatible integer to pointer conversion assigning to 'struct dentry *' from 'int' [-Wint-conversion]
dent = lookup_one(user_ns, priv->d_info->name,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/ksmbd/smb2pdu.c:5640:6: warning: variable 'user_ns' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (ksmbd_stream_fd(fp))
^~~~~~~~~~~~~~~~~~~
fs/ksmbd/smb2pdu.c:5662:31: note: uninitialized use occurs here
return smb2_rename(work, fp, user_ns,
^~~~~~~
fs/ksmbd/smb2pdu.c:5640:2: note: remove the 'if' if its condition is always false
if (ksmbd_stream_fd(fp))
^~~~~~~~~~~~~~~~~~~~~~~~
fs/ksmbd/smb2pdu.c:5629:32: note: initialize the variable 'user_ns' to silence this warning
struct user_namespace *user_ns;
^
= NULL
2 warnings and 1 error generated.
vim +5640 fs/ksmbd/smb2pdu.c
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5625
64b39f4a2fd293 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-30 5626 static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp,
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5627 char *buf)
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5628 {
4b499755e1024f fs/ksmbd/smb2pdu.c Christian Brauner 2021-08-16 5629 struct user_namespace *user_ns;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5630 struct ksmbd_file *parent_fp;
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5631 struct dentry *parent;
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5632 struct dentry *dentry = fp->filp->f_path.dentry;
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5633 int ret;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5634
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5635 if (!(fp->daccess & FILE_DELETE_LE)) {
bde1694aecdb53 fs/cifsd/smb2pdu.c Namjae Jeon 2021-06-28 5636 pr_err("no right to delete : 0x%x\n", fp->daccess);
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5637 return -EACCES;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5638 }
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5639
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 @5640 if (ksmbd_stream_fd(fp))
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5641 goto next;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5642
4b499755e1024f fs/ksmbd/smb2pdu.c Christian Brauner 2021-08-16 5643 user_ns = file_mnt_user_ns(fp->filp);
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5644 parent = dget_parent(dentry);
4b499755e1024f fs/ksmbd/smb2pdu.c Christian Brauner 2021-08-16 5645 ret = ksmbd_vfs_lock_parent(user_ns, parent, dentry);
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5646 if (ret) {
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5647 dput(parent);
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5648 return ret;
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5649 }
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5650
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5651 parent_fp = ksmbd_lookup_fd_inode(d_inode(parent));
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5652 inode_unlock(d_inode(parent));
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5653 dput(parent);
12202c0594b182 fs/ksmbd/smb2pdu.c Namjae Jeon 2021-06-29 5654
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5655 if (parent_fp) {
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5656 if (parent_fp->daccess & FILE_DELETE_LE) {
bde1694aecdb53 fs/cifsd/smb2pdu.c Namjae Jeon 2021-06-28 5657 pr_err("parent dir is opened with delete access\n");
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5658 return -ESHARE;
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5659 }
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5660 }
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5661 next:
4b499755e1024f fs/ksmbd/smb2pdu.c Christian Brauner 2021-08-16 5662 return smb2_rename(work, fp, user_ns,
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5663 (struct smb2_file_rename_info *)buf,
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5664 work->sess->conn->local_nls);
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5665 }
e2f34481b24db2 fs/cifsd/smb2pdu.c Namjae Jeon 2021-03-16 5666
:::::: The code at line 5640 was first introduced by commit
:::::: e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 cifsd: add server-side procedures for SMB3
:::::: TO: Namjae Jeon <namjae.jeon@samsung.com>
:::::: CC: Steve French <stfrench@microsoft.com>
---
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: 25870 bytes --]
next reply other threads:[~2021-08-25 7:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-25 7:14 kernel test robot [this message]
2021-08-25 7:14 ` [smfrench-smb3-kernel:pr/65 143/143] fs/ksmbd/smb2pdu.c:5640:6: warning: variable 'user_ns' is used uninitialized whenever 'if' condition is true kernel test robot
2021-08-25 8:20 ` Christian Brauner
2021-08-25 8:20 ` Christian Brauner
2021-08-26 0:32 ` [kbuild-all] " Rong Chen
2021-08-26 0:32 ` Rong Chen
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=202108251550.SXFHPzdJ-lkp@intel.com \
--to=lkp@intel.com \
--cc=christian.brauner@ubuntu.com \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namjae.jeon@samsung.com \
--cc=stfrench@microsoft.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.