All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH v1 4/4] ubifs: auth: consult encrypted and trusted keys if no logon key was found
Date: Thu, 22 Jul 2021 22:45:14 +0800	[thread overview]
Message-ID: <202107222215.o8cy55m6-lkp@intel.com> (raw)
In-Reply-To: <f5891611f329583baef32089c8b322850d81166a.1626945419.git-series.a.fatoum@pengutronix.de>

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

Hi Ahmad,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on 2734d6c1b1a089fb593ef6a23d4b70903526fe0c]

url:    https://github.com/0day-ci/linux/commits/Ahmad-Fatoum/keys-introduce-key_extract_material-helper/20210722-172029
base:   2734d6c1b1a089fb593ef6a23d4b70903526fe0c
config: alpha-randconfig-r011-20210722 (attached as .config)
compiler: alpha-linux-gcc (GCC) 10.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
        # https://github.com/0day-ci/linux/commit/1f09360d0a6ad6d739b7d5195e8c71516d0c3381
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ahmad-Fatoum/keys-introduce-key_extract_material-helper/20210722-172029
        git checkout 1f09360d0a6ad6d739b7d5195e8c71516d0c3381
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=alpha 

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 >>):

   fs/ubifs/auth.c: In function 'ubifs_init_authentication':
>> fs/ubifs/auth.c:285:6: warning: ignoring return value of 'IS_ERR' declared with attribute 'warn_unused_result' [-Wunused-result]
     285 |  if (IS_ERR(keyring_key) && IS_REACHABLE(CONFIG_TRUSTED_KEYS))
         |      ^~~~~~~~~~~~~~~~~~~


vim +285 fs/ubifs/auth.c

   251	
   252	/**
   253	 * ubifs_init_authentication - initialize UBIFS authentication support
   254	 * @c: UBIFS file-system description object
   255	 *
   256	 * This function returns 0 for success or a negative error code otherwise.
   257	 */
   258	int ubifs_init_authentication(struct ubifs_info *c)
   259	{
   260		struct key *keyring_key;
   261		int err;
   262		unsigned int len;
   263		char hmac_name[CRYPTO_MAX_ALG_NAME];
   264		const void *key_material;
   265	
   266		if (!c->auth_hash_name) {
   267			ubifs_err(c, "authentication hash name needed with authentication");
   268			return -EINVAL;
   269		}
   270	
   271		c->auth_hash_algo = match_string(hash_algo_name, HASH_ALGO__LAST,
   272						 c->auth_hash_name);
   273		if ((int)c->auth_hash_algo < 0) {
   274			ubifs_err(c, "Unknown hash algo %s specified",
   275				  c->auth_hash_name);
   276			return -EINVAL;
   277		}
   278	
   279		snprintf(hmac_name, CRYPTO_MAX_ALG_NAME, "hmac(%s)",
   280			 c->auth_hash_name);
   281	
   282		keyring_key = request_key(&key_type_logon, c->auth_key_name, NULL);
   283		if (IS_ERR(keyring_key) && IS_REACHABLE(CONFIG_ENCRYPTED_KEYS))
   284			keyring_key = request_key(&key_type_encrypted, c->auth_key_name, NULL);
 > 285		if (IS_ERR(keyring_key) && IS_REACHABLE(CONFIG_TRUSTED_KEYS))
   286			keyring_key = request_key(&key_type_trusted, c->auth_key_name, NULL);
   287	
   288		if (IS_ERR(keyring_key)) {
   289			ubifs_err(c, "Failed to request key: %ld",
   290				  PTR_ERR(keyring_key));
   291			return PTR_ERR(keyring_key);
   292		}
   293	
   294		down_read(&keyring_key->sem);
   295	
   296		key_material = key_extract_material(keyring_key, &len);
   297		err = PTR_ERR_OR_ZERO(key_material);
   298		if (err < 0)
   299			goto out;
   300	
   301		c->hash_tfm = crypto_alloc_shash(c->auth_hash_name, 0, 0);
   302		if (IS_ERR(c->hash_tfm)) {
   303			err = PTR_ERR(c->hash_tfm);
   304			ubifs_err(c, "Can not allocate %s: %d",
   305				  c->auth_hash_name, err);
   306			goto out;
   307		}
   308	
   309		c->hash_len = crypto_shash_digestsize(c->hash_tfm);
   310		if (c->hash_len > UBIFS_HASH_ARR_SZ) {
   311			ubifs_err(c, "hash %s is bigger than maximum allowed hash size (%d > %d)",
   312				  c->auth_hash_name, c->hash_len, UBIFS_HASH_ARR_SZ);
   313			err = -EINVAL;
   314			goto out_free_hash;
   315		}
   316	
   317		c->hmac_tfm = crypto_alloc_shash(hmac_name, 0, 0);
   318		if (IS_ERR(c->hmac_tfm)) {
   319			err = PTR_ERR(c->hmac_tfm);
   320			ubifs_err(c, "Can not allocate %s: %d", hmac_name, err);
   321			goto out_free_hash;
   322		}
   323	
   324		c->hmac_desc_len = crypto_shash_digestsize(c->hmac_tfm);
   325		if (c->hmac_desc_len > UBIFS_HMAC_ARR_SZ) {
   326			ubifs_err(c, "hmac %s is bigger than maximum allowed hmac size (%d > %d)",
   327				  hmac_name, c->hmac_desc_len, UBIFS_HMAC_ARR_SZ);
   328			err = -EINVAL;
   329			goto out_free_hmac;
   330		}
   331	
   332		err = crypto_shash_setkey(c->hmac_tfm, key_material, len);
   333		if (err)
   334			goto out_free_hmac;
   335	
   336		c->authenticated = true;
   337	
   338		c->log_hash = ubifs_hash_get_desc(c);
   339		if (IS_ERR(c->log_hash)) {
   340			err = PTR_ERR(c->log_hash);
   341			goto out_free_hmac;
   342		}
   343	
   344		err = 0;
   345	
   346	out_free_hmac:
   347		if (err)
   348			crypto_free_shash(c->hmac_tfm);
   349	out_free_hash:
   350		if (err)
   351			crypto_free_shash(c->hash_tfm);
   352	out:
   353		up_read(&keyring_key->sem);
   354		key_put(keyring_key);
   355	
   356		return err;
   357	}
   358	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

  reply	other threads:[~2021-07-22 14:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  9:17 [RFC PATCH v1 0/4] keys: introduce key_extract_material helper Ahmad Fatoum
2021-07-22  9:17 ` [dm-devel] " Ahmad Fatoum
2021-07-22  9:17 ` Ahmad Fatoum
2021-07-22  9:17 ` [RFC PATCH v1 1/4] " Ahmad Fatoum
2021-07-22  9:17   ` [dm-devel] " Ahmad Fatoum
2021-07-22  9:17   ` Ahmad Fatoum
2021-07-22  9:18 ` [RFC PATCH v1 2/4] dm: crypt: use new " Ahmad Fatoum
2021-07-22  9:18   ` [dm-devel] " Ahmad Fatoum
2021-07-22  9:18   ` Ahmad Fatoum
2021-07-22  9:18 ` [RFC PATCH v1 3/4] ubifs: auth: remove never hit key type error check Ahmad Fatoum
2021-07-22  9:18   ` [dm-devel] " Ahmad Fatoum
2021-07-22  9:18   ` Ahmad Fatoum
2021-07-22  9:18 ` [RFC PATCH v1 4/4] ubifs: auth: consult encrypted and trusted keys if no logon key was found Ahmad Fatoum
2021-07-22  9:18   ` [dm-devel] " Ahmad Fatoum
2021-07-22  9:18   ` Ahmad Fatoum
2021-07-22 14:45   ` kernel test robot [this message]
2021-08-06 10:53 ` [RFC PATCH v1 0/4] keys: introduce key_extract_material helper Ahmad Fatoum
2021-08-06 10:53   ` [dm-devel] " Ahmad Fatoum
2021-08-06 10:53   ` Ahmad Fatoum

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=202107222215.o8cy55m6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.