mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [ebiggers:crypto-pending 3/7] crypto/xctr.c:66:22: sparse: sparse: restricted __le32 degrades to integer
@ 2022-02-15  3:42 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-15  3:42 UTC (permalink / raw)
  To: Nathan Huckleberry; +Cc: kbuild-all, linux-kernel, Eric Biggers

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git crypto-pending
head:   67824d3cb5325de4264ad344174a7e4ea69e5303
commit: d98684f7dc5be61c6380f6c5a4d5dae44c6ddbca [3/7] crypto: hctr2 - Add HCTR2 support
config: arm-randconfig-s031-20220214 (https://download.01.org/0day-ci/archive/20220215/202202151139.J5pKremk-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/commit/?id=d98684f7dc5be61c6380f6c5a4d5dae44c6ddbca
        git remote add ebiggers https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git
        git fetch --no-tags ebiggers crypto-pending
        git checkout d98684f7dc5be61c6380f6c5a4d5dae44c6ddbca
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> crypto/xctr.c:66:22: sparse: sparse: restricted __le32 degrades to integer
   crypto/xctr.c:94:22: sparse: sparse: restricted __le32 degrades to integer

vim +66 crypto/xctr.c

8330f8a6b750f6 Nathan Huckleberry 2022-02-10  48  
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  49  static int crypto_xctr_crypt_segment(struct skcipher_walk *walk,
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  50  				    struct crypto_cipher *tfm, u32 byte_ctr)
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  51  {
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  52  	void (*fn)(struct crypto_tfm *, u8 *, const u8 *) =
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  53  		   crypto_cipher_alg(tfm)->cia_encrypt;
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  54  	u8 *src = walk->src.virt.addr;
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  55  	u8 *dst = walk->dst.virt.addr;
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  56  	unsigned int nbytes = walk->nbytes;
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  57  	__le32 ctr32 = cpu_to_le32(byte_ctr / XCTR_BLOCKSIZE + 1);
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  58  
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  59  	do {
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  60  		/* create keystream */
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  61  		crypto_xor(walk->iv, (u8 *)&ctr32, sizeof(ctr32));
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  62  		fn(crypto_cipher_tfm(tfm), dst, walk->iv);
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  63  		crypto_xor(dst, src, XCTR_BLOCKSIZE);
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  64  		crypto_xor(walk->iv, (u8 *)&ctr32, sizeof(ctr32));
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  65  
8330f8a6b750f6 Nathan Huckleberry 2022-02-10 @66  		ctr32++;
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  67  
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  68  		src += XCTR_BLOCKSIZE;
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  69  		dst += XCTR_BLOCKSIZE;
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  70  	} while ((nbytes -= XCTR_BLOCKSIZE) >= XCTR_BLOCKSIZE);
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  71  
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  72  	return nbytes;
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  73  }
8330f8a6b750f6 Nathan Huckleberry 2022-02-10  74  

:::::: The code at line 66 was first introduced by commit
:::::: 8330f8a6b750f6b7b65987a27d4bf7d2bebde570 crypto: xctr - Add XCTR support

:::::: TO: Nathan Huckleberry <nhuck@google.com>
:::::: CC: Eric Biggers <ebiggers@google.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-15  3:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15  3:42 [ebiggers:crypto-pending 3/7] crypto/xctr.c:66:22: sparse: sparse: restricted __le32 degrades to integer kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®