[cryptodev:master 118/131] arch/s390/crypto/aes_s390.c:271:1: warning: 'fallback_blk_dec' uses dynamic stack allocation

[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:   98eca72fa04a9bbf28dba95efaec5aa95588fe23
commit: 64e26807bb93b4accaa395d98e118ab893cac074 [118/131] crypto: s390/aes - Use skcipher for fallback
config: s390-allyesconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 5.3.1-8) 5.3.1 20160205
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 64e26807bb93b4accaa395d98e118ab893cac074
        # save the attached .config to linux build tree
        make.cross ARCH=s390 

All warnings (new ones prefixed by >>):

   arch/s390/crypto/aes_s390.c: In function 'fallback_blk_dec':
>> arch/s390/crypto/aes_s390.c:271:1: warning: 'fallback_blk_dec' uses dynamic stack allocation
    }
    ^
   arch/s390/crypto/aes_s390.c: In function 'ecb_aes_encrypt':
>> arch/s390/crypto/aes_s390.c:355:1: warning: 'ecb_aes_encrypt' uses dynamic stack allocation
    }
    ^
   arch/s390/crypto/aes_s390.c: In function 'cbc_aes_encrypt':
>> arch/s390/crypto/aes_s390.c:496:1: warning: 'cbc_aes_encrypt' uses dynamic stack allocation
    }
    ^
   arch/s390/crypto/aes_s390.c: In function 'xts_aes_decrypt':
>> arch/s390/crypto/aes_s390.c:703:1: warning: 'xts_aes_decrypt' uses dynamic stack allocation
    }
    ^
   arch/s390/crypto/aes_s390.c: In function 'xts_aes_encrypt':
>> arch/s390/crypto/aes_s390.c:689:1: warning: 'xts_aes_encrypt' uses dynamic stack allocation
    }
    ^

vim +/fallback_blk_dec +271 arch/s390/crypto/aes_s390.c

64e26807 Herbert Xu         2016-06-29  265  	skcipher_request_set_crypt(req, src, dst, nbytes, desc->info);
b0c3e75d Sebastian Siewior  2007-12-01  266  
64e26807 Herbert Xu         2016-06-29  267  	ret = crypto_skcipher_decrypt(req);
b0c3e75d Sebastian Siewior  2007-12-01  268  
64e26807 Herbert Xu         2016-06-29  269  	skcipher_request_zero(req);
b0c3e75d Sebastian Siewior  2007-12-01  270  	return ret;
b0c3e75d Sebastian Siewior  2007-12-01 @271  }
b0c3e75d Sebastian Siewior  2007-12-01  272  
b0c3e75d Sebastian Siewior  2007-12-01  273  static int fallback_blk_enc(struct blkcipher_desc *desc,
b0c3e75d Sebastian Siewior  2007-12-01  274  		struct scatterlist *dst, struct scatterlist *src,
b0c3e75d Sebastian Siewior  2007-12-01  275  		unsigned int nbytes)
b0c3e75d Sebastian Siewior  2007-12-01  276  {
b0c3e75d Sebastian Siewior  2007-12-01  277  	unsigned int ret;
64e26807 Herbert Xu         2016-06-29  278  	struct crypto_blkcipher *tfm = desc->tfm;
64e26807 Herbert Xu         2016-06-29  279  	struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(tfm);
64e26807 Herbert Xu         2016-06-29  280  	SKCIPHER_REQUEST_ON_STACK(req, sctx->fallback.blk);
b0c3e75d Sebastian Siewior  2007-12-01  281  
64e26807 Herbert Xu         2016-06-29  282  	skcipher_request_set_tfm(req, sctx->fallback.blk);
64e26807 Herbert Xu         2016-06-29  283  	skcipher_request_set_callback(req, desc->flags, NULL, NULL);
64e26807 Herbert Xu         2016-06-29  284  	skcipher_request_set_crypt(req, src, dst, nbytes, desc->info);
b0c3e75d Sebastian Siewior  2007-12-01  285  
64e26807 Herbert Xu         2016-06-29  286  	ret = crypto_skcipher_encrypt(req);
b0c3e75d Sebastian Siewior  2007-12-01  287  	return ret;
b0c3e75d Sebastian Siewior  2007-12-01  288  }
b0c3e75d Sebastian Siewior  2007-12-01  289  
a9e62fad Herbert Xu         2006-08-21  290  static int ecb_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
a9e62fad Herbert Xu         2006-08-21  291  			   unsigned int key_len)
a9e62fad Herbert Xu         2006-08-21  292  {
a9e62fad Herbert Xu         2006-08-21  293  	struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
b0c3e75d Sebastian Siewior  2007-12-01  294  	int ret;
b0c3e75d Sebastian Siewior  2007-12-01  295  
b0c3e75d Sebastian Siewior  2007-12-01  296  	ret = need_fallback(key_len);
b0c3e75d Sebastian Siewior  2007-12-01  297  	if (ret > 0) {
b0c3e75d Sebastian Siewior  2007-12-01  298  		sctx->key_len = key_len;
b0c3e75d Sebastian Siewior  2007-12-01  299  		return setkey_fallback_blk(tfm, in_key, key_len);
b0c3e75d Sebastian Siewior  2007-12-01  300  	}
a9e62fad Herbert Xu         2006-08-21  301  
a9e62fad Herbert Xu         2006-08-21  302  	switch (key_len) {
a9e62fad Herbert Xu         2006-08-21  303  	case 16:
c7d4d259 Martin Schwidefsky 2016-03-17  304  		sctx->enc = CPACF_KM_AES_128_ENC;
c7d4d259 Martin Schwidefsky 2016-03-17  305  		sctx->dec = CPACF_KM_AES_128_DEC;
a9e62fad Herbert Xu         2006-08-21  306  		break;
a9e62fad Herbert Xu         2006-08-21  307  	case 24:
c7d4d259 Martin Schwidefsky 2016-03-17  308  		sctx->enc = CPACF_KM_AES_192_ENC;
c7d4d259 Martin Schwidefsky 2016-03-17  309  		sctx->dec = CPACF_KM_AES_192_DEC;
a9e62fad Herbert Xu         2006-08-21  310  		break;
a9e62fad Herbert Xu         2006-08-21  311  	case 32:
c7d4d259 Martin Schwidefsky 2016-03-17  312  		sctx->enc = CPACF_KM_AES_256_ENC;
c7d4d259 Martin Schwidefsky 2016-03-17  313  		sctx->dec = CPACF_KM_AES_256_DEC;
a9e62fad Herbert Xu         2006-08-21  314  		break;
a9e62fad Herbert Xu         2006-08-21  315  	}
a9e62fad Herbert Xu         2006-08-21  316  
a9e62fad Herbert Xu         2006-08-21  317  	return aes_set_key(tfm, in_key, key_len);
a9e62fad Herbert Xu         2006-08-21  318  }
a9e62fad Herbert Xu         2006-08-21  319  
a9e62fad Herbert Xu         2006-08-21  320  static int ecb_aes_crypt(struct blkcipher_desc *desc, long func, void *param,
a9e62fad Herbert Xu         2006-08-21  321  			 struct blkcipher_walk *walk)
a9e62fad Herbert Xu         2006-08-21  322  {
a9e62fad Herbert Xu         2006-08-21  323  	int ret = blkcipher_walk_virt(desc, walk);
a9e62fad Herbert Xu         2006-08-21  324  	unsigned int nbytes;
a9e62fad Herbert Xu         2006-08-21  325  
a9e62fad Herbert Xu         2006-08-21  326  	while ((nbytes = walk->nbytes)) {
a9e62fad Herbert Xu         2006-08-21  327  		/* only use complete blocks */
a9e62fad Herbert Xu         2006-08-21  328  		unsigned int n = nbytes & ~(AES_BLOCK_SIZE - 1);
a9e62fad Herbert Xu         2006-08-21  329  		u8 *out = walk->dst.virt.addr;
a9e62fad Herbert Xu         2006-08-21  330  		u8 *in = walk->src.virt.addr;
a9e62fad Herbert Xu         2006-08-21  331  
c7d4d259 Martin Schwidefsky 2016-03-17  332  		ret = cpacf_km(func, param, out, in, n);
36eb2caa Jan Glauber        2012-10-26  333  		if (ret < 0 || ret != n)
36eb2caa Jan Glauber        2012-10-26  334  			return -EIO;
a9e62fad Herbert Xu         2006-08-21  335  
a9e62fad Herbert Xu         2006-08-21  336  		nbytes &= AES_BLOCK_SIZE - 1;
a9e62fad Herbert Xu         2006-08-21  337  		ret = blkcipher_walk_done(desc, walk, nbytes);
a9e62fad Herbert Xu         2006-08-21  338  	}
a9e62fad Herbert Xu         2006-08-21  339  
a9e62fad Herbert Xu         2006-08-21  340  	return ret;
a9e62fad Herbert Xu         2006-08-21  341  }
a9e62fad Herbert Xu         2006-08-21  342  
a9e62fad Herbert Xu         2006-08-21  343  static int ecb_aes_encrypt(struct blkcipher_desc *desc,
a9e62fad Herbert Xu         2006-08-21  344  			   struct scatterlist *dst, struct scatterlist *src,
a9e62fad Herbert Xu         2006-08-21  345  			   unsigned int nbytes)
a9e62fad Herbert Xu         2006-08-21  346  {
a9e62fad Herbert Xu         2006-08-21  347  	struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm);
a9e62fad Herbert Xu         2006-08-21  348  	struct blkcipher_walk walk;
a9e62fad Herbert Xu         2006-08-21  349  
b0c3e75d Sebastian Siewior  2007-12-01  350  	if (unlikely(need_fallback(sctx->key_len)))
b0c3e75d Sebastian Siewior  2007-12-01  351  		return fallback_blk_enc(desc, dst, src, nbytes);
b0c3e75d Sebastian Siewior  2007-12-01  352  
a9e62fad Herbert Xu         2006-08-21  353  	blkcipher_walk_init(&walk, dst, src, nbytes);
a9e62fad Herbert Xu         2006-08-21  354  	return ecb_aes_crypt(desc, sctx->enc, sctx->key, &walk);
a9e62fad Herbert Xu         2006-08-21 @355  }
a9e62fad Herbert Xu         2006-08-21  356  
a9e62fad Herbert Xu         2006-08-21  357  static int ecb_aes_decrypt(struct blkcipher_desc *desc,
a9e62fad Herbert Xu         2006-08-21  358  			   struct scatterlist *dst, struct scatterlist *src,

:::::: The code at line 271 was first introduced by commit
:::::: b0c3e75d857f3785a4b274e26b1c0b2327580dda [CRYPTO] aes_s390: Add fallback driver

:::::: TO: Sebastian Siewior <sebastian@xxxxxxxxxxxxx>
:::::: 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: Binary data


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

  Powered by Linux