public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christian Brauner <brauner@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Christian Brauner <christianvanbrauner@gmail.com>
Subject: [brauner-vfs:vfs.xattr 5/5] fs/xattr.c:838:39: warning: variable 'lookup_flags' is uninitialized when used here
Date: Wed, 1 May 2024 02:54:41 +0800	[thread overview]
Message-ID: <202405010227.h8ewojO3-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.xattr
head:   0703b9aad555387113b9112cdc84469d12fda266
commit: 0703b9aad555387113b9112cdc84469d12fda266 [5/5] xattr: handle AT_EMPTY_PATH correctly
config: s390-allnoconfig (https://download.01.org/0day-ci/archive/20240501/202405010227.h8ewojO3-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 37ae4ad0eef338776c7e2cffb3896153d43dcd90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240501/202405010227.h8ewojO3-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/oe-kbuild-all/202405010227.h8ewojO3-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from fs/xattr.c:15:
   In file included from include/linux/xattr.h:18:
   In file included from include/linux/mm.h:2208:
   include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     522 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> fs/xattr.c:838:39: warning: variable 'lookup_flags' is uninitialized when used here [-Wuninitialized]
     838 |                 error = user_path_at(dfd, pathname, lookup_flags, &path);
         |                                                     ^~~~~~~~~~~~
   fs/xattr.c:822:18: note: initialize the variable 'lookup_flags' to silence this warning
     822 |         int lookup_flags;
         |                         ^
         |                          = 0
   fs/xattr.c:955:39: warning: variable 'lookup_flags' is uninitialized when used here [-Wuninitialized]
     955 |                 error = user_path_at(dfd, pathname, lookup_flags, &path);
         |                                                     ^~~~~~~~~~~~
   fs/xattr.c:939:18: note: initialize the variable 'lookup_flags' to silence this warning
     939 |         int lookup_flags;
         |                         ^
         |                          = 0
   3 warnings generated.


vim +/lookup_flags +838 fs/xattr.c

^1da177e4c3f41 Linus Torvalds     2005-04-16  815  
71491cbe0205be Christian Göttsche 2024-04-26  816  static ssize_t do_getxattrat(int dfd, const char __user *pathname, unsigned int at_flags,
8cc431165d8fbd Eric Biggers       2014-10-12  817  			     const char __user *name, void __user *value,
71491cbe0205be Christian Göttsche 2024-04-26  818  			     size_t size)
^1da177e4c3f41 Linus Torvalds     2005-04-16  819  {
2d8f30380ab8c7 Al Viro            2008-07-22  820  	struct path path;
0703b9aad55538 Christian Brauner  2024-04-30  821  	ssize_t error = 0;
71491cbe0205be Christian Göttsche 2024-04-26  822  	int lookup_flags;
71491cbe0205be Christian Göttsche 2024-04-26  823  
71491cbe0205be Christian Göttsche 2024-04-26  824  	if ((at_flags & ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH)) != 0)
71491cbe0205be Christian Göttsche 2024-04-26  825  		return -EINVAL;
71491cbe0205be Christian Göttsche 2024-04-26  826  
0703b9aad55538 Christian Brauner  2024-04-30  827  	if (at_flags & AT_EMPTY_PATH && vfs_empty_path(dfd, pathname)) {
0703b9aad55538 Christian Brauner  2024-04-30  828  		CLASS(fd, f)(dfd);
0703b9aad55538 Christian Brauner  2024-04-30  829  
0703b9aad55538 Christian Brauner  2024-04-30  830  		if (!f.file)
0703b9aad55538 Christian Brauner  2024-04-30  831  			return -EBADF;
0703b9aad55538 Christian Brauner  2024-04-30  832  
0703b9aad55538 Christian Brauner  2024-04-30  833  		path = f.file->f_path;
0703b9aad55538 Christian Brauner  2024-04-30  834  		audit_file(f.file);
0703b9aad55538 Christian Brauner  2024-04-30  835  		path_get(&path);
0703b9aad55538 Christian Brauner  2024-04-30  836  	} else {
60e66b48ca2081 Jeff Layton        2012-12-11  837  retry:
71491cbe0205be Christian Göttsche 2024-04-26 @838  		error = user_path_at(dfd, pathname, lookup_flags, &path);
^1da177e4c3f41 Linus Torvalds     2005-04-16  839  		if (error)
^1da177e4c3f41 Linus Torvalds     2005-04-16  840  			return error;
0703b9aad55538 Christian Brauner  2024-04-30  841  	}
5a6f52d20ce3cd Christian Brauner  2022-10-28  842  	error = getxattr(mnt_idmap(path.mnt), path.dentry, name, value, size);
2d8f30380ab8c7 Al Viro            2008-07-22  843  	path_put(&path);
60e66b48ca2081 Jeff Layton        2012-12-11  844  	if (retry_estale(error, lookup_flags)) {
60e66b48ca2081 Jeff Layton        2012-12-11  845  		lookup_flags |= LOOKUP_REVAL;
60e66b48ca2081 Jeff Layton        2012-12-11  846  		goto retry;
60e66b48ca2081 Jeff Layton        2012-12-11  847  	}
^1da177e4c3f41 Linus Torvalds     2005-04-16  848  	return error;
^1da177e4c3f41 Linus Torvalds     2005-04-16  849  }
^1da177e4c3f41 Linus Torvalds     2005-04-16  850  

:::::: The code at line 838 was first introduced by commit
:::::: 71491cbe0205be53be1a044594698eb21c1c15f4 fs/xattr: add *at family syscalls

:::::: TO: Christian Göttsche <cgzones@googlemail.com>
:::::: CC: Christian Brauner <brauner@kernel.org>

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

                 reply	other threads:[~2024-04-30 18:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202405010227.h8ewojO3-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brauner@kernel.org \
    --cc=christianvanbrauner@gmail.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox