[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202007221444.qrjrcDG0%lkp@intel.com>
Date: Wed, 22 Jul 2020 14:42:57 +0800
From: kernel test robot <lkp@...el.com>
To: trix@...hat.com, dhowells@...hat.com,
jarkko.sakkinen@...ux.intel.com, jmorris@...ei.org,
serge@...lyn.com, denkenz@...il.com, marcel@...tmann.org
Cc: kbuild-all@...ts.01.org, keyrings@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, Tom Rix <trix@...hat.com>
Subject: Re: [PATCH] KEYS: remove redundant memsets
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on security/next-testing]
[also build test WARNING on linus/master dhowells-fs/fscache-next v5.8-rc6 next-20200721]
[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/trix-redhat-com/KEYS-remove-redundant-memsets/20200721-221633
base: https://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-testing
config: microblaze-randconfig-r022-20200719 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
security/keys/keyctl_pkey.c: In function 'keyctl_pkey_params_get_2':
>> security/keys/keyctl_pkey.c:122:8: warning: 'uparams.key_id' is used uninitialized in this function [-Wuninitialized]
122 | ret = keyctl_pkey_params_get(uparams.key_id, _info, params);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +122 security/keys/keyctl_pkey.c
00d60fd3b93219 David Howells 2018-10-09 108
00d60fd3b93219 David Howells 2018-10-09 109 /*
00d60fd3b93219 David Howells 2018-10-09 110 * Get parameters from userspace. Callers must always call the free function
00d60fd3b93219 David Howells 2018-10-09 111 * on params, even if an error is returned.
00d60fd3b93219 David Howells 2018-10-09 112 */
00d60fd3b93219 David Howells 2018-10-09 113 static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_params,
00d60fd3b93219 David Howells 2018-10-09 114 const char __user *_info,
00d60fd3b93219 David Howells 2018-10-09 115 int op,
00d60fd3b93219 David Howells 2018-10-09 116 struct kernel_pkey_params *params)
00d60fd3b93219 David Howells 2018-10-09 117 {
00d60fd3b93219 David Howells 2018-10-09 118 struct keyctl_pkey_params uparams;
00d60fd3b93219 David Howells 2018-10-09 119 struct kernel_pkey_query info;
00d60fd3b93219 David Howells 2018-10-09 120 int ret;
00d60fd3b93219 David Howells 2018-10-09 121
00d60fd3b93219 David Howells 2018-10-09 @122 ret = keyctl_pkey_params_get(uparams.key_id, _info, params);
00d60fd3b93219 David Howells 2018-10-09 123 if (ret < 0)
00d60fd3b93219 David Howells 2018-10-09 124 return ret;
00d60fd3b93219 David Howells 2018-10-09 125
00d60fd3b93219 David Howells 2018-10-09 126 ret = params->key->type->asym_query(params, &info);
00d60fd3b93219 David Howells 2018-10-09 127 if (ret < 0)
00d60fd3b93219 David Howells 2018-10-09 128 return ret;
00d60fd3b93219 David Howells 2018-10-09 129
bb67c86855f477 Tom Rix 2020-07-21 130 if (copy_from_user(&uparams, _params, sizeof(uparams)) != 0)
bb67c86855f477 Tom Rix 2020-07-21 131 return -EFAULT;
bb67c86855f477 Tom Rix 2020-07-21 132
00d60fd3b93219 David Howells 2018-10-09 133 switch (op) {
00d60fd3b93219 David Howells 2018-10-09 134 case KEYCTL_PKEY_ENCRYPT:
00d60fd3b93219 David Howells 2018-10-09 135 case KEYCTL_PKEY_DECRYPT:
00d60fd3b93219 David Howells 2018-10-09 136 if (uparams.in_len > info.max_enc_size ||
00d60fd3b93219 David Howells 2018-10-09 137 uparams.out_len > info.max_dec_size)
00d60fd3b93219 David Howells 2018-10-09 138 return -EINVAL;
00d60fd3b93219 David Howells 2018-10-09 139 break;
00d60fd3b93219 David Howells 2018-10-09 140 case KEYCTL_PKEY_SIGN:
00d60fd3b93219 David Howells 2018-10-09 141 case KEYCTL_PKEY_VERIFY:
00d60fd3b93219 David Howells 2018-10-09 142 if (uparams.in_len > info.max_sig_size ||
00d60fd3b93219 David Howells 2018-10-09 143 uparams.out_len > info.max_data_size)
00d60fd3b93219 David Howells 2018-10-09 144 return -EINVAL;
00d60fd3b93219 David Howells 2018-10-09 145 break;
00d60fd3b93219 David Howells 2018-10-09 146 default:
00d60fd3b93219 David Howells 2018-10-09 147 BUG();
00d60fd3b93219 David Howells 2018-10-09 148 }
00d60fd3b93219 David Howells 2018-10-09 149
00d60fd3b93219 David Howells 2018-10-09 150 params->in_len = uparams.in_len;
00d60fd3b93219 David Howells 2018-10-09 151 params->out_len = uparams.out_len;
00d60fd3b93219 David Howells 2018-10-09 152 return 0;
00d60fd3b93219 David Howells 2018-10-09 153 }
00d60fd3b93219 David Howells 2018-10-09 154
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (24894 bytes)
Powered by blists - more mailing lists