All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Regression fixes/clean ups in the Qualcomm crypto engine driver
@ 2021-01-20 18:48 Thara Gopinath
  2021-01-20 18:48 ` [PATCH v3 1/6] drivers: crypto: qce: sha: Restore/save ahash state with custom struct in export/import Thara Gopinath
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Thara Gopinath @ 2021-01-20 18:48 UTC (permalink / raw)
  To: herbert, davem, bjorn.andersson
  Cc: ebiggers, ardb, sivaprak, linux-crypto, linux-kernel

This patch series is a result of running kernel crypto fuzz tests (by
enabling CONFIG_CRYPTO_MANAGER_EXTRA_TESTS) on the transformations
currently supported via the Qualcomm crypto engine on sdm845.  The first
four patches are fixes for various regressions found during testing. The
last two patches are minor clean ups of unused variable and parameters.

v2->v3:
	- Made the comparison between keys to check if any two keys are
	  same for triple des algorithms constant-time as per
	  Nym Seddon's suggestion.
	- Rebased to 5.11-rc4.
v1->v2:
	- Introduced custom struct qce_sha_saved_state to store and restore
	  partial sha transformation.
	- Rebased to 5.11-rc3.

Thara Gopinath (6):
  drivers: crypto: qce: sha: Restore/save ahash state with custom struct
    in export/import
  drivers: crypto: qce: sha: Hold back a block of data to be transferred
    as part of final
  drivers: crypto: qce: skcipher: Fix regressions found during fuzz
    testing
  drivers: crypto: qce: common: Set data unit size to message length for
    AES XTS transformation
  drivers: crypto: qce: Remover src_tbl from qce_cipher_reqctx
  drivers: crypto: qce: Remove totallen and offset in qce_start

 drivers/crypto/qce/cipher.h   |   1 -
 drivers/crypto/qce/common.c   |  25 +++---
 drivers/crypto/qce/common.h   |   3 +-
 drivers/crypto/qce/sha.c      | 143 +++++++++++++---------------------
 drivers/crypto/qce/skcipher.c |  70 ++++++++++++++---
 5 files changed, 127 insertions(+), 115 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: [PATCH v3 3/6] drivers: crypto: qce: skcipher: Fix regressions found during fuzz testing
@ 2021-01-21  0:04 kernel test robot
  0 siblings, 0 replies; 16+ messages in thread
From: kernel test robot @ 2021-01-21  0:04 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210120184843.3217775-4-thara.gopinath@linaro.org>
References: <20210120184843.3217775-4-thara.gopinath@linaro.org>
TO: Thara Gopinath <thara.gopinath@linaro.org>
TO: herbert(a)gondor.apana.org.au
TO: davem(a)davemloft.net
TO: bjorn.andersson(a)linaro.org
CC: ebiggers(a)google.com
CC: ardb(a)kernel.org
CC: sivaprak(a)codeaurora.org
CC: linux-crypto(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

Hi Thara,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on cryptodev/master]
[also build test WARNING on crypto/master v5.11-rc4 next-20210120]
[cannot apply to sparc-next/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Thara-Gopinath/Regression-fixes-clean-ups-in-the-Qualcomm-crypto-engine-driver/20210121-032302
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: alpha-randconfig-s032-20210120 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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.3-208-g46a52ca4-dirty
        # https://github.com/0day-ci/linux/commit/2eb9a0d7f44a35ca2528cb2af18c3550e7af6bc8
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Thara-Gopinath/Regression-fixes-clean-ups-in-the-Qualcomm-crypto-engine-driver/20210121-032302
        git checkout 2eb9a0d7f44a35ca2528cb2af18c3550e7af6bc8
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha 

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 >>)"
>> drivers/crypto/qce/skcipher.c:239:58: sparse: sparse: dubious: !x | !y
   drivers/crypto/qce/skcipher.c:240:58: sparse: sparse: dubious: x | !y

vim +239 drivers/crypto/qce/skcipher.c

5feaaae1b549f351 drivers/crypto/qce/ablkcipher.c Herbert Xu     2019-04-11  218  
8bf0871539faa090 drivers/crypto/qce/skcipher.c   Ard Biesheuvel 2019-11-09  219  static int qce_des3_setkey(struct crypto_skcipher *ablk, const u8 *key,
f96c897c855cfbde drivers/crypto/qce/ablkcipher.c Ard Biesheuvel 2019-08-15  220  			   unsigned int keylen)
f96c897c855cfbde drivers/crypto/qce/ablkcipher.c Ard Biesheuvel 2019-08-15  221  {
8bf0871539faa090 drivers/crypto/qce/skcipher.c   Ard Biesheuvel 2019-11-09  222  	struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(ablk);
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  223  	u32 _key[6];
f96c897c855cfbde drivers/crypto/qce/ablkcipher.c Ard Biesheuvel 2019-08-15  224  	int err;
f96c897c855cfbde drivers/crypto/qce/ablkcipher.c Ard Biesheuvel 2019-08-15  225  
8bf0871539faa090 drivers/crypto/qce/skcipher.c   Ard Biesheuvel 2019-11-09  226  	err = verify_skcipher_des3_key(ablk, key);
f96c897c855cfbde drivers/crypto/qce/ablkcipher.c Ard Biesheuvel 2019-08-15  227  	if (err)
f96c897c855cfbde drivers/crypto/qce/ablkcipher.c Ard Biesheuvel 2019-08-15  228  		return err;
f96c897c855cfbde drivers/crypto/qce/ablkcipher.c Ard Biesheuvel 2019-08-15  229  
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  230  	/*
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  231  	 * The crypto engine does not support any two keys
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  232  	 * being the same for triple des algorithms. The
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  233  	 * verify_skcipher_des3_key does not check for all the
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  234  	 * below conditions. Return -ENOKEY in case any two keys
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  235  	 * are the same. Revisit to see if a fallback cipher
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  236  	 * is needed to handle this condition.
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  237  	 */
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  238  	memcpy(_key, key, DES3_EDE_KEY_SIZE);
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20 @239  	if (!((_key[0] ^ _key[2]) | (_key[1] ^ _key[3])) |
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  240  	    !((_key[2] ^ _key[4]) | (_key[3] ^ _key[5])) |
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  241  	    !((_key[0] ^ _key[4]) | (_key[1] ^ _key[5])))
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  242  		return -ENOKEY;
2eb9a0d7f44a35ca drivers/crypto/qce/skcipher.c   Thara Gopinath 2021-01-20  243  
5feaaae1b549f351 drivers/crypto/qce/ablkcipher.c Herbert Xu     2019-04-11  244  	ctx->enc_keylen = keylen;
5feaaae1b549f351 drivers/crypto/qce/ablkcipher.c Herbert Xu     2019-04-11  245  	memcpy(ctx->enc_key, key, keylen);
5feaaae1b549f351 drivers/crypto/qce/ablkcipher.c Herbert Xu     2019-04-11  246  	return 0;
5feaaae1b549f351 drivers/crypto/qce/ablkcipher.c Herbert Xu     2019-04-11  247  }
5feaaae1b549f351 drivers/crypto/qce/ablkcipher.c Herbert Xu     2019-04-11  248  

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

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

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

end of thread, other threads:[~2021-02-02 23:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-20 18:48 [PATCH v3 0/6] Regression fixes/clean ups in the Qualcomm crypto engine driver Thara Gopinath
2021-01-20 18:48 ` [PATCH v3 1/6] drivers: crypto: qce: sha: Restore/save ahash state with custom struct in export/import Thara Gopinath
2021-01-25 16:07   ` Bjorn Andersson
2021-02-02 23:49   ` kernel test robot
2021-02-02 23:49     ` kernel test robot
2021-01-20 18:48 ` [PATCH v3 2/6] drivers: crypto: qce: sha: Hold back a block of data to be transferred as part of final Thara Gopinath
2021-01-25 16:19   ` Bjorn Andersson
2021-01-20 18:48 ` [PATCH v3 3/6] drivers: crypto: qce: skcipher: Fix regressions found during fuzz testing Thara Gopinath
2021-01-25 16:25   ` Bjorn Andersson
2021-01-20 18:48 ` [PATCH v3 4/6] drivers: crypto: qce: common: Set data unit size to message length for AES XTS transformation Thara Gopinath
2021-01-25 16:31   ` Bjorn Andersson
2021-01-20 18:48 ` [PATCH v3 5/6] drivers: crypto: qce: Remover src_tbl from qce_cipher_reqctx Thara Gopinath
2021-01-25 16:32   ` Bjorn Andersson
2021-01-20 18:48 ` [PATCH v3 6/6] drivers: crypto: qce: Remove totallen and offset in qce_start Thara Gopinath
2021-01-25 16:34   ` Bjorn Andersson
  -- strict thread matches above, loose matches on Subject: below --
2021-01-21  0:04 [PATCH v3 3/6] drivers: crypto: qce: skcipher: Fix regressions found during fuzz testing kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.