public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [brauner-vfs:vfs.xattr 5/5] fs/xattr.c:838:39: warning: variable 'lookup_flags' is uninitialized when used here
@ 2024-04-30 18:54 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-30 18:54 UTC (permalink / raw)
  To: Christian Brauner; +Cc: llvm, oe-kbuild-all, Christian Brauner

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-30 18:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30 18:54 [brauner-vfs:vfs.xattr 5/5] fs/xattr.c:838:39: warning: variable 'lookup_flags' is uninitialized when used here kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox