[cryptodev:master 29/53] drivers/crypto/inside-secure/safexcel_cipher.c:457:1: warning: the frame size of 1072 bytes is larger than 1024 bytes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   4fd7d7befdb531920cae8f78afd4938e4a25e421
commit: bb7679b840cc7cf23868e05c5ef7a044e7fafd97 [29/53] crypto: inside-secure - Added support for authenc HMAC-SHA1/DES-CBC
config: i386-randconfig-g004-201940 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        git checkout bb7679b840cc7cf23868e05c5ef7a044e7fafd97
        # save the attached .config to linux build tree
        make ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/crypto/inside-secure/safexcel_cipher.c: In function 'safexcel_aead_setkey':
>> drivers/crypto/inside-secure/safexcel_cipher.c:457:1: warning: the frame size of 1072 bytes is larger than 1024 bytes [-Wframe-larger-than=]
    }
    ^

vim +457 drivers/crypto/inside-secure/safexcel_cipher.c

1b44c5a60c137e Antoine Tenart     2017-05-24  341  
77cdd4efe57134 Pascal van Leeuwen 2019-07-05  342  static int safexcel_aead_setkey(struct crypto_aead *ctfm, const u8 *key,
f6beaea304872b Antoine Tenart     2018-05-14  343  				unsigned int len)
f6beaea304872b Antoine Tenart     2018-05-14  344  {
f6beaea304872b Antoine Tenart     2018-05-14  345  	struct crypto_tfm *tfm = crypto_aead_tfm(ctfm);
f6beaea304872b Antoine Tenart     2018-05-14  346  	struct safexcel_cipher_ctx *ctx = crypto_tfm_ctx(tfm);
f6beaea304872b Antoine Tenart     2018-05-14  347  	struct safexcel_ahash_export_state istate, ostate;
f6beaea304872b Antoine Tenart     2018-05-14  348  	struct safexcel_crypto_priv *priv = ctx->priv;
f6beaea304872b Antoine Tenart     2018-05-14  349  	struct crypto_authenc_keys keys;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  350  	struct crypto_aes_ctx aes;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  351  	int err = -EINVAL;
f6beaea304872b Antoine Tenart     2018-05-14  352  
1769f704e55b11 Pascal van Leeuwen 2019-09-13  353  	if (unlikely(crypto_authenc_extractkeys(&keys, key, len)))
f6beaea304872b Antoine Tenart     2018-05-14  354  		goto badkey;
f6beaea304872b Antoine Tenart     2018-05-14  355  
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  356  	if (ctx->mode == CONTEXT_CONTROL_CRYPTO_MODE_CTR_LOAD) {
1769f704e55b11 Pascal van Leeuwen 2019-09-13  357  		/* Must have at least space for the nonce here */
1769f704e55b11 Pascal van Leeuwen 2019-09-13  358  		if (unlikely(keys.enckeylen < CTR_RFC3686_NONCE_SIZE))
f6beaea304872b Antoine Tenart     2018-05-14  359  			goto badkey;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  360  		/* last 4 bytes of key are the nonce! */
f26882a3475eb7 Pascal van Leeuwen 2019-07-30  361  		ctx->nonce = *(u32 *)(keys.enckey + keys.enckeylen -
f26882a3475eb7 Pascal van Leeuwen 2019-07-30  362  				      CTR_RFC3686_NONCE_SIZE);
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  363  		/* exclude the nonce here */
1769f704e55b11 Pascal van Leeuwen 2019-09-13  364  		keys.enckeylen -= CTR_RFC3686_NONCE_SIZE;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  365  	}
f6beaea304872b Antoine Tenart     2018-05-14  366  
f6beaea304872b Antoine Tenart     2018-05-14  367  	/* Encryption key */
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  368  	switch (ctx->alg) {
bb7679b840cc7c Pascal van Leeuwen 2019-09-13  369  	case SAFEXCEL_DES:
bb7679b840cc7c Pascal van Leeuwen 2019-09-13  370  		err = verify_aead_des_key(ctfm, keys.enckey, keys.enckeylen);
bb7679b840cc7c Pascal van Leeuwen 2019-09-13  371  		if (unlikely(err))
bb7679b840cc7c Pascal van Leeuwen 2019-09-13  372  			goto badkey_expflags;
bb7679b840cc7c Pascal van Leeuwen 2019-09-13  373  		break;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  374  	case SAFEXCEL_3DES:
21f5a15e0f26c7 Ard Biesheuvel     2019-08-15  375  		err = verify_aead_des3_key(ctfm, keys.enckey, keys.enckeylen);
77cdd4efe57134 Pascal van Leeuwen 2019-07-05  376  		if (unlikely(err))
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  377  			goto badkey_expflags;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  378  		break;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  379  	case SAFEXCEL_AES:
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  380  		err = aes_expandkey(&aes, keys.enckey, keys.enckeylen);
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  381  		if (unlikely(err))
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  382  			goto badkey;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  383  		break;
1769f704e55b11 Pascal van Leeuwen 2019-09-13  384  	case SAFEXCEL_SM4:
1769f704e55b11 Pascal van Leeuwen 2019-09-13  385  		if (unlikely(keys.enckeylen != SM4_KEY_SIZE))
1769f704e55b11 Pascal van Leeuwen 2019-09-13  386  			goto badkey;
1769f704e55b11 Pascal van Leeuwen 2019-09-13  387  		break;
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  388  	default:
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  389  		dev_err(priv->dev, "aead: unsupported cipher algorithm\n");
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  390  		goto badkey;
77cdd4efe57134 Pascal van Leeuwen 2019-07-05  391  	}
77cdd4efe57134 Pascal van Leeuwen 2019-07-05  392  
53c83e915ce8b2 Antoine Tenart     2018-06-28  393  	if (priv->flags & EIP197_TRC_CACHE && ctx->base.ctxr_dma &&
f6beaea304872b Antoine Tenart     2018-05-14  394  	    memcmp(ctx->key, keys.enckey, keys.enckeylen))
f6beaea304872b Antoine Tenart     2018-05-14  395  		ctx->base.needs_inv = true;
f6beaea304872b Antoine Tenart     2018-05-14  396  
f6beaea304872b Antoine Tenart     2018-05-14  397  	/* Auth key */
a7dea8c0ff9f25 Ofer Heifetz       2018-06-28  398  	switch (ctx->hash_alg) {
01ba061d0fd769 Antoine Tenart     2018-05-14  399  	case CONTEXT_CONTROL_CRYPTO_ALG_SHA1:
01ba061d0fd769 Antoine Tenart     2018-05-14  400  		if (safexcel_hmac_setkey("safexcel-sha1", keys.authkey,
01ba061d0fd769 Antoine Tenart     2018-05-14  401  					 keys.authkeylen, &istate, &ostate))
01ba061d0fd769 Antoine Tenart     2018-05-14  402  			goto badkey;
01ba061d0fd769 Antoine Tenart     2018-05-14  403  		break;
678b2878ac396f Antoine Tenart     2018-05-14  404  	case CONTEXT_CONTROL_CRYPTO_ALG_SHA224:
678b2878ac396f Antoine Tenart     2018-05-14  405  		if (safexcel_hmac_setkey("safexcel-sha224", keys.authkey,
678b2878ac396f Antoine Tenart     2018-05-14  406  					 keys.authkeylen, &istate, &ostate))
678b2878ac396f Antoine Tenart     2018-05-14  407  			goto badkey;
678b2878ac396f Antoine Tenart     2018-05-14  408  		break;
678b2878ac396f Antoine Tenart     2018-05-14  409  	case CONTEXT_CONTROL_CRYPTO_ALG_SHA256:
f6beaea304872b Antoine Tenart     2018-05-14  410  		if (safexcel_hmac_setkey("safexcel-sha256", keys.authkey,
f6beaea304872b Antoine Tenart     2018-05-14  411  					 keys.authkeylen, &istate, &ostate))
f6beaea304872b Antoine Tenart     2018-05-14  412  			goto badkey;
678b2878ac396f Antoine Tenart     2018-05-14  413  		break;
ea23cb533ce419 Antoine Tenart     2018-05-29  414  	case CONTEXT_CONTROL_CRYPTO_ALG_SHA384:
ea23cb533ce419 Antoine Tenart     2018-05-29  415  		if (safexcel_hmac_setkey("safexcel-sha384", keys.authkey,
ea23cb533ce419 Antoine Tenart     2018-05-29  416  					 keys.authkeylen, &istate, &ostate))
ea23cb533ce419 Antoine Tenart     2018-05-29  417  			goto badkey;
ea23cb533ce419 Antoine Tenart     2018-05-29  418  		break;
87eee125e7490c Antoine Tenart     2018-05-29  419  	case CONTEXT_CONTROL_CRYPTO_ALG_SHA512:
87eee125e7490c Antoine Tenart     2018-05-29  420  		if (safexcel_hmac_setkey("safexcel-sha512", keys.authkey,
87eee125e7490c Antoine Tenart     2018-05-29  421  					 keys.authkeylen, &istate, &ostate))
87eee125e7490c Antoine Tenart     2018-05-29  422  			goto badkey;
87eee125e7490c Antoine Tenart     2018-05-29  423  		break;
1769f704e55b11 Pascal van Leeuwen 2019-09-13  424  	case CONTEXT_CONTROL_CRYPTO_ALG_SM3:
1769f704e55b11 Pascal van Leeuwen 2019-09-13  425  		if (safexcel_hmac_setkey("safexcel-sm3", keys.authkey,
1769f704e55b11 Pascal van Leeuwen 2019-09-13  426  					 keys.authkeylen, &istate, &ostate))
1769f704e55b11 Pascal van Leeuwen 2019-09-13  427  			goto badkey;
1769f704e55b11 Pascal van Leeuwen 2019-09-13  428  		break;
678b2878ac396f Antoine Tenart     2018-05-14  429  	default:
a60619211dd188 Pascal van Leeuwen 2019-09-18  430  		dev_err(priv->dev, "aead: unsupported hash algorithmn");
678b2878ac396f Antoine Tenart     2018-05-14  431  		goto badkey;
678b2878ac396f Antoine Tenart     2018-05-14  432  	}
f6beaea304872b Antoine Tenart     2018-05-14  433  
f6beaea304872b Antoine Tenart     2018-05-14  434  	crypto_aead_set_flags(ctfm, crypto_aead_get_flags(ctfm) &
f6beaea304872b Antoine Tenart     2018-05-14  435  				    CRYPTO_TFM_RES_MASK);
f6beaea304872b Antoine Tenart     2018-05-14  436  
53c83e915ce8b2 Antoine Tenart     2018-06-28  437  	if (priv->flags & EIP197_TRC_CACHE && ctx->base.ctxr_dma &&
f6beaea304872b Antoine Tenart     2018-05-14  438  	    (memcmp(ctx->ipad, istate.state, ctx->state_sz) ||
f6beaea304872b Antoine Tenart     2018-05-14  439  	     memcmp(ctx->opad, ostate.state, ctx->state_sz)))
f6beaea304872b Antoine Tenart     2018-05-14  440  		ctx->base.needs_inv = true;
f6beaea304872b Antoine Tenart     2018-05-14  441  
f6beaea304872b Antoine Tenart     2018-05-14  442  	/* Now copy the keys into the context */
f6beaea304872b Antoine Tenart     2018-05-14  443  	memcpy(ctx->key, keys.enckey, keys.enckeylen);
f6beaea304872b Antoine Tenart     2018-05-14  444  	ctx->key_len = keys.enckeylen;
f6beaea304872b Antoine Tenart     2018-05-14  445  
f6beaea304872b Antoine Tenart     2018-05-14  446  	memcpy(ctx->ipad, &istate.state, ctx->state_sz);
f6beaea304872b Antoine Tenart     2018-05-14  447  	memcpy(ctx->opad, &ostate.state, ctx->state_sz);
f6beaea304872b Antoine Tenart     2018-05-14  448  
f6beaea304872b Antoine Tenart     2018-05-14  449  	memzero_explicit(&keys, sizeof(keys));
f6beaea304872b Antoine Tenart     2018-05-14  450  	return 0;
f6beaea304872b Antoine Tenart     2018-05-14  451  
f6beaea304872b Antoine Tenart     2018-05-14  452  badkey:
f6beaea304872b Antoine Tenart     2018-05-14  453  	crypto_aead_set_flags(ctfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  454  badkey_expflags:
f6beaea304872b Antoine Tenart     2018-05-14  455  	memzero_explicit(&keys, sizeof(keys));
0e17e3621a28a6 Pascal van Leeuwen 2019-07-05  456  	return err;
f6beaea304872b Antoine Tenart     2018-05-14 @457  }
f6beaea304872b Antoine Tenart     2018-05-14  458  

:::::: The code at line 457 was first introduced by commit
:::::: f6beaea304872bb1c76bf6c551386bf896cac8b9 crypto: inside-secure - authenc(hmac(sha256), cbc(aes)) support

:::::: TO: Antoine Tenart <antoine.tenart@xxxxxxxxxxx>
:::::: CC: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux