linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: trix@redhat.com, dhowells@redhat.com,
	jarkko.sakkinen@linux.intel.com, jmorris@namei.org,
	serge@hallyn.com, denkenz@gmail.com, marcel@holtmann.org
Cc: kbuild-all@lists.01.org, keyrings@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, Tom Rix <trix@redhat.com>
Subject: Re: [PATCH] KEYS: remove redundant memsets
Date: Wed, 22 Jul 2020 14:42:57 +0800	[thread overview]
Message-ID: <202007221444.qrjrcDG0%lkp@intel.com> (raw)
In-Reply-To: <20200721141516.20335-1-trix@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4930 bytes --]

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@intel.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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24894 bytes --]

  reply	other threads:[~2020-07-22  6:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 14:15 [PATCH] KEYS: remove redundant memsets trix
2020-07-22  6:42 ` kernel test robot [this message]
2020-07-22  8:01 ` David Howells

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=202007221444.qrjrcDG0%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=denkenz@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jmorris@namei.org \
    --cc=kbuild-all@lists.01.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=serge@hallyn.com \
    --cc=trix@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).