linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* include/crypto/internal/des.h:31: undefined reference to `des_expand_key'
@ 2019-11-23 23:42 kbuild test robot
  2019-11-26 11:28 ` [PATCH] crypto: talitos - Fix build error by selecting LIB_DES Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2019-11-23 23:42 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: kbuild-all, linux-kernel, Herbert Xu

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

Hi Ard,

It's probably a bug fix that unveils the link errors.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2027cabe6afea5d471401ec704b65ce18f958fdc
commit: 18fbe0da8e98fe167fbfe1757003e2a2a74d24f3 crypto: des - remove now unused __des3_ede_setkey()
date:   3 months ago
config: powerpc-randconfig-a001-20191124 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 18fbe0da8e98fe167fbfe1757003e2a2a74d24f3
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/crypto/talitos.o: In function `crypto_des_verify_key':
>> include/crypto/internal/des.h:31: undefined reference to `des_expand_key'

vim +31 include/crypto/internal/des.h

6ee41e5420d0af Ard Biesheuvel 2019-08-15  14  
6ee41e5420d0af Ard Biesheuvel 2019-08-15  15  /**
6ee41e5420d0af Ard Biesheuvel 2019-08-15  16   * crypto_des_verify_key - Check whether a DES key is weak
6ee41e5420d0af Ard Biesheuvel 2019-08-15  17   * @tfm: the crypto algo
6ee41e5420d0af Ard Biesheuvel 2019-08-15  18   * @key: the key buffer
6ee41e5420d0af Ard Biesheuvel 2019-08-15  19   *
6ee41e5420d0af Ard Biesheuvel 2019-08-15  20   * Returns -EINVAL if the key is weak and the crypto TFM does not permit weak
6ee41e5420d0af Ard Biesheuvel 2019-08-15  21   * keys. Otherwise, 0 is returned.
6ee41e5420d0af Ard Biesheuvel 2019-08-15  22   *
6ee41e5420d0af Ard Biesheuvel 2019-08-15  23   * It is the job of the caller to ensure that the size of the key equals
6ee41e5420d0af Ard Biesheuvel 2019-08-15  24   * DES_KEY_SIZE.
6ee41e5420d0af Ard Biesheuvel 2019-08-15  25   */
6ee41e5420d0af Ard Biesheuvel 2019-08-15  26  static inline int crypto_des_verify_key(struct crypto_tfm *tfm, const u8 *key)
6ee41e5420d0af Ard Biesheuvel 2019-08-15  27  {
04007b0e6cbbab Ard Biesheuvel 2019-08-15  28  	struct des_ctx tmp;
04007b0e6cbbab Ard Biesheuvel 2019-08-15  29  	int err;
6ee41e5420d0af Ard Biesheuvel 2019-08-15  30  
04007b0e6cbbab Ard Biesheuvel 2019-08-15 @31  	err = des_expand_key(&tmp, key, DES_KEY_SIZE);
04007b0e6cbbab Ard Biesheuvel 2019-08-15  32  	if (err == -ENOKEY) {
04007b0e6cbbab Ard Biesheuvel 2019-08-15  33  		if (crypto_tfm_get_flags(tfm) & CRYPTO_TFM_REQ_FORBID_WEAK_KEYS)
6ee41e5420d0af Ard Biesheuvel 2019-08-15  34  			err = -EINVAL;
04007b0e6cbbab Ard Biesheuvel 2019-08-15  35  		else
04007b0e6cbbab Ard Biesheuvel 2019-08-15  36  			err = 0;
6ee41e5420d0af Ard Biesheuvel 2019-08-15  37  	}
6ee41e5420d0af Ard Biesheuvel 2019-08-15  38  
04007b0e6cbbab Ard Biesheuvel 2019-08-15  39  	if (err)
04007b0e6cbbab Ard Biesheuvel 2019-08-15  40  		crypto_tfm_set_flags(tfm, CRYPTO_TFM_RES_WEAK_KEY);
04007b0e6cbbab Ard Biesheuvel 2019-08-15  41  
04007b0e6cbbab Ard Biesheuvel 2019-08-15  42  	memzero_explicit(&tmp, sizeof(tmp));
6ee41e5420d0af Ard Biesheuvel 2019-08-15  43  	return err;
6ee41e5420d0af Ard Biesheuvel 2019-08-15  44  }
6ee41e5420d0af Ard Biesheuvel 2019-08-15  45  

:::::: The code at line 31 was first introduced by commit
:::::: 04007b0e6cbbab5836ac891626e91edf10d46341 crypto: des - split off DES library from generic DES cipher driver

:::::: TO: Ard Biesheuvel <ard.biesheuvel@linaro.org>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] crypto: talitos - Fix build error by selecting LIB_DES
  2019-11-23 23:42 include/crypto/internal/des.h:31: undefined reference to `des_expand_key' kbuild test robot
@ 2019-11-26 11:28 ` Herbert Xu
  2019-11-26 11:37   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2019-11-26 11:28 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Ard Biesheuvel, kbuild-all, linux-kernel, Linux Crypto Mailing List

On Sun, Nov 24, 2019 at 07:42:21AM +0800, kbuild test robot wrote:
>
> All errors (new ones prefixed by >>):
> 
>    drivers/crypto/talitos.o: In function `crypto_des_verify_key':
> >> include/crypto/internal/des.h:31: undefined reference to `des_expand_key'

This patch should fix it.

---8<---
The talitos driver needs to select LIB_DES as it needs calls
des_expand_key.

Fixes: 9d574ae8ebc1 ("crypto: talitos/des - switch to new...")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 43ed1b621718..91eb768d4221 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -289,6 +289,7 @@ config CRYPTO_DEV_TALITOS
 	select CRYPTO_AUTHENC
 	select CRYPTO_SKCIPHER
 	select CRYPTO_HASH
+	select CRYPTO_LIB_DES
 	select HW_RANDOM
 	depends on FSL_SOC
 	help
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: talitos - Fix build error by selecting LIB_DES
  2019-11-26 11:28 ` [PATCH] crypto: talitos - Fix build error by selecting LIB_DES Herbert Xu
@ 2019-11-26 11:37   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2019-11-26 11:37 UTC (permalink / raw)
  To: Herbert Xu
  Cc: kbuild test robot, kbuild-all, Linux Kernel Mailing List,
	Linux Crypto Mailing List

On Tue, 26 Nov 2019 at 12:28, Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Sun, Nov 24, 2019 at 07:42:21AM +0800, kbuild test robot wrote:
> >
> > All errors (new ones prefixed by >>):
> >
> >    drivers/crypto/talitos.o: In function `crypto_des_verify_key':
> > >> include/crypto/internal/des.h:31: undefined reference to `des_expand_key'
>
> This patch should fix it.
>
> ---8<---
> The talitos driver needs to select LIB_DES as it needs calls
> des_expand_key.
>
> Fixes: 9d574ae8ebc1 ("crypto: talitos/des - switch to new...")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

> diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
> index 43ed1b621718..91eb768d4221 100644
> --- a/drivers/crypto/Kconfig
> +++ b/drivers/crypto/Kconfig
> @@ -289,6 +289,7 @@ config CRYPTO_DEV_TALITOS
>         select CRYPTO_AUTHENC
>         select CRYPTO_SKCIPHER
>         select CRYPTO_HASH
> +       select CRYPTO_LIB_DES
>         select HW_RANDOM
>         depends on FSL_SOC
>         help
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-26 11:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23 23:42 include/crypto/internal/des.h:31: undefined reference to `des_expand_key' kbuild test robot
2019-11-26 11:28 ` [PATCH] crypto: talitos - Fix build error by selecting LIB_DES Herbert Xu
2019-11-26 11:37   ` Ard Biesheuvel

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