lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202151139.J5pKremk-lkp@intel.com>
Date:   Tue, 15 Feb 2022 11:42:43 +0800
From:   kernel test robot <lkp@...el.com>
To:     Nathan Huckleberry <nhuck@...gle.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Eric Biggers <ebiggers@...gle.com>
Subject: [ebiggers:crypto-pending 3/7] crypto/xctr.c:66:22: sparse: sparse:
 restricted __le32 degrades to integer

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@...el.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@...gle.com>
:::::: CC: Eric Biggers <ebiggers@...gle.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ