lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211282239.j5bmIZXh-lkp@intel.com>
Date:   Mon, 28 Nov 2022 22:16:41 +0800
From:   kernel test robot <lkp@...el.com>
To:     Alexander Larsson <alexl@...hat.com>, linux-fsdevel@...r.kernel.org
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        gscrivan@...hat.com, alexl@...hat.com
Subject: Re: [PATCH 6/6] composefs: Add kconfig and build support

Hi Alexander,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on fscrypt/fsverity]
[also build test WARNING on linus/master v6.1-rc7 next-20221128]
[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/Alexander-Larsson/Composefs-an-opportunistically-sharing-verified-image-filesystem/20221128-192140
base:   https://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git fsverity
patch link:    https://lore.kernel.org/r/a0524f492d2ac64b99f3de6ea2b27249a4bcadad.1669631086.git.alexl%40redhat.com
patch subject: [PATCH 6/6] composefs: Add kconfig and build support
config: sparc-allyesconfig
compiler: sparc64-linux-gcc (GCC) 12.1.0
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/intel-lab-lkp/linux/commit/b1d98075a6a519fa9405dd2cd273ed2e00f12266
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Alexander-Larsson/Composefs-an-opportunistically-sharing-verified-image-filesystem/20221128-192140
        git checkout b1d98075a6a519fa9405dd2cd273ed2e00f12266
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash fs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   fs/composefs/cfs-reader.c: In function 'cfs_list_xattrs':
>> fs/composefs/cfs-reader.c:605:40: warning: variable 'this_value' set but not used [-Wunused-but-set-variable]
     605 |                 const char *this_key, *this_value;
         |                                        ^~~~~~~~~~


vim +/this_value +605 fs/composefs/cfs-reader.c

c286cdbef4137f Alexander Larsson 2022-11-28  569  
c286cdbef4137f Alexander Larsson 2022-11-28  570  ssize_t cfs_list_xattrs(struct cfs_context_s *ctx,
c286cdbef4137f Alexander Larsson 2022-11-28  571  			struct cfs_inode_data_s *inode_data, char *names,
c286cdbef4137f Alexander Larsson 2022-11-28  572  			size_t size)
c286cdbef4137f Alexander Larsson 2022-11-28  573  {
c286cdbef4137f Alexander Larsson 2022-11-28  574  	u8 *data, *data_end;
c286cdbef4137f Alexander Larsson 2022-11-28  575  	size_t n_xattrs = 0, i;
c286cdbef4137f Alexander Larsson 2022-11-28  576  	ssize_t copied = 0;
c286cdbef4137f Alexander Larsson 2022-11-28  577  	const struct cfs_xattr_header_s *xattrs;
c286cdbef4137f Alexander Larsson 2022-11-28  578  	struct cfs_buf vdata_buf = CFS_VDATA_BUF_INIT;
c286cdbef4137f Alexander Larsson 2022-11-28  579  
c286cdbef4137f Alexander Larsson 2022-11-28  580  	if (inode_data->xattrs_len == 0)
c286cdbef4137f Alexander Larsson 2022-11-28  581  		return 0;
c286cdbef4137f Alexander Larsson 2022-11-28  582  
c286cdbef4137f Alexander Larsson 2022-11-28  583  	/* xattrs_len basic size req was verified in cfs_init_inode_data */
c286cdbef4137f Alexander Larsson 2022-11-28  584  
c286cdbef4137f Alexander Larsson 2022-11-28  585  	xattrs = cfs_get_vdata_buf(ctx, inode_data->xattrs_offset,
c286cdbef4137f Alexander Larsson 2022-11-28  586  				   inode_data->xattrs_len, &vdata_buf);
c286cdbef4137f Alexander Larsson 2022-11-28  587  	if (IS_ERR(xattrs))
c286cdbef4137f Alexander Larsson 2022-11-28  588  		return PTR_ERR(xattrs);
c286cdbef4137f Alexander Larsson 2022-11-28  589  
c286cdbef4137f Alexander Larsson 2022-11-28  590  	n_xattrs = cfs_u16_from_file(xattrs->n_attr);
c286cdbef4137f Alexander Larsson 2022-11-28  591  
c286cdbef4137f Alexander Larsson 2022-11-28  592  	/* Verify that array fits */
c286cdbef4137f Alexander Larsson 2022-11-28  593  	if (inode_data->xattrs_len < cfs_xattr_header_size(n_xattrs)) {
c286cdbef4137f Alexander Larsson 2022-11-28  594  		copied = -EFSCORRUPTED;
c286cdbef4137f Alexander Larsson 2022-11-28  595  		goto exit;
c286cdbef4137f Alexander Larsson 2022-11-28  596  	}
c286cdbef4137f Alexander Larsson 2022-11-28  597  
c286cdbef4137f Alexander Larsson 2022-11-28  598  	data = ((u8 *)xattrs) + cfs_xattr_header_size(n_xattrs);
c286cdbef4137f Alexander Larsson 2022-11-28  599  	data_end = ((u8 *)xattrs) + inode_data->xattrs_len;
c286cdbef4137f Alexander Larsson 2022-11-28  600  
c286cdbef4137f Alexander Larsson 2022-11-28  601  	for (i = 0; i < n_xattrs; i++) {
c286cdbef4137f Alexander Larsson 2022-11-28  602  		const struct cfs_xattr_element_s *e = &xattrs->attr[i];
c286cdbef4137f Alexander Larsson 2022-11-28  603  		u16 this_key_len = cfs_u16_from_file(e->key_length);
c286cdbef4137f Alexander Larsson 2022-11-28  604  		u16 this_value_len = cfs_u16_from_file(e->value_length);
c286cdbef4137f Alexander Larsson 2022-11-28 @605  		const char *this_key, *this_value;
c286cdbef4137f Alexander Larsson 2022-11-28  606  
c286cdbef4137f Alexander Larsson 2022-11-28  607  		if (this_key_len > XATTR_NAME_MAX ||
c286cdbef4137f Alexander Larsson 2022-11-28  608  		    /* key and data needs to fit in data */
c286cdbef4137f Alexander Larsson 2022-11-28  609  		    data_end - data < this_key_len + this_value_len) {
c286cdbef4137f Alexander Larsson 2022-11-28  610  			copied = -EFSCORRUPTED;
c286cdbef4137f Alexander Larsson 2022-11-28  611  			goto exit;
c286cdbef4137f Alexander Larsson 2022-11-28  612  		}
c286cdbef4137f Alexander Larsson 2022-11-28  613  
c286cdbef4137f Alexander Larsson 2022-11-28  614  		this_key = data;
c286cdbef4137f Alexander Larsson 2022-11-28  615  		this_value = data + this_key_len;
c286cdbef4137f Alexander Larsson 2022-11-28  616  		data += this_key_len + this_value_len;
c286cdbef4137f Alexander Larsson 2022-11-28  617  
c286cdbef4137f Alexander Larsson 2022-11-28  618  		if (size) {
c286cdbef4137f Alexander Larsson 2022-11-28  619  			if (size - copied < this_key_len + 1) {
c286cdbef4137f Alexander Larsson 2022-11-28  620  				copied = -E2BIG;
c286cdbef4137f Alexander Larsson 2022-11-28  621  				goto exit;
c286cdbef4137f Alexander Larsson 2022-11-28  622  			}
c286cdbef4137f Alexander Larsson 2022-11-28  623  
c286cdbef4137f Alexander Larsson 2022-11-28  624  			memcpy(names + copied, this_key, this_key_len);
c286cdbef4137f Alexander Larsson 2022-11-28  625  			names[copied + this_key_len] = '\0';
c286cdbef4137f Alexander Larsson 2022-11-28  626  		}
c286cdbef4137f Alexander Larsson 2022-11-28  627  
c286cdbef4137f Alexander Larsson 2022-11-28  628  		copied += this_key_len + 1;
c286cdbef4137f Alexander Larsson 2022-11-28  629  	}
c286cdbef4137f Alexander Larsson 2022-11-28  630  
c286cdbef4137f Alexander Larsson 2022-11-28  631  exit:
c286cdbef4137f Alexander Larsson 2022-11-28  632  	cfs_buf_put(&vdata_buf);
c286cdbef4137f Alexander Larsson 2022-11-28  633  
c286cdbef4137f Alexander Larsson 2022-11-28  634  	return copied;
c286cdbef4137f Alexander Larsson 2022-11-28  635  }
c286cdbef4137f Alexander Larsson 2022-11-28  636  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (322210 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ