[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8011818d-bdc1-433a-a348-648955c55535@stanley.mountain>
Date: Mon, 28 Oct 2024 11:47:14 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, Christian Marangi <ansuelsmth@...il.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Antoine Tenart <atenart@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>, Boqun Feng <boqun.feng@...il.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, linux-crypto@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, upstream@...oha.com
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org,
Richard van Schagen <vschagen@...oud.com>
Subject: Re: [PATCH v4 3/3] crypto: Add Mediatek EIP-93 crypto engine support
Hi Christian,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/dt-bindings-crypto-Add-Inside-Secure-SafeXcel-EIP-93-crypto-engine/20241025-175032
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link: https://lore.kernel.org/r/20241025094734.1614-3-ansuelsmth%40gmail.com
patch subject: [PATCH v4 3/3] crypto: Add Mediatek EIP-93 crypto engine support
config: csky-randconfig-r071-20241028 (https://download.01.org/0day-ci/archive/20241028/202410281155.jEN0wSbS-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.1.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202410281155.jEN0wSbS-lkp@intel.com/
New smatch warnings:
drivers/crypto/inside-secure/eip93/eip93-cipher.c:118 eip93_skcipher_setkey() error: uninitialized symbol 'ret'.
drivers/crypto/inside-secure/eip93/eip93-aead.c:125 eip93_aead_setkey() error: uninitialized symbol 'ret'.
drivers/crypto/inside-secure/eip93/eip93-hash.c:26 eip93_hash_free_data_blocks() error: dereferencing freed memory 'block'
drivers/crypto/inside-secure/eip93/eip93-hash.c:162 _eip93_hash_init() error: uninitialized symbol 'sa_record_hmac'.
Old smatch warnings:
drivers/crypto/inside-secure/eip93/eip93-hash.c:285 eip93_send_hash_req() error: uninitialized symbol 'crypto_async_idr'.
vim +/ret +118 drivers/crypto/inside-secure/eip93/eip93-cipher.c
883ad7684f17d2 Christian Marangi 2024-10-25 78 static int eip93_skcipher_setkey(struct crypto_skcipher *ctfm, const u8 *key,
883ad7684f17d2 Christian Marangi 2024-10-25 79 unsigned int len)
883ad7684f17d2 Christian Marangi 2024-10-25 80 {
883ad7684f17d2 Christian Marangi 2024-10-25 81 struct crypto_tfm *tfm = crypto_skcipher_tfm(ctfm);
883ad7684f17d2 Christian Marangi 2024-10-25 82 struct eip93_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
883ad7684f17d2 Christian Marangi 2024-10-25 83 struct eip93_alg_template *tmpl = container_of(tfm->__crt_alg,
883ad7684f17d2 Christian Marangi 2024-10-25 84 struct eip93_alg_template,
883ad7684f17d2 Christian Marangi 2024-10-25 85 alg.skcipher.base);
883ad7684f17d2 Christian Marangi 2024-10-25 86 struct sa_record *sa_record = ctx->sa_record;
883ad7684f17d2 Christian Marangi 2024-10-25 87 unsigned int keylen = len;
883ad7684f17d2 Christian Marangi 2024-10-25 88 u32 flags = tmpl->flags;
883ad7684f17d2 Christian Marangi 2024-10-25 89 u32 nonce = 0;
883ad7684f17d2 Christian Marangi 2024-10-25 90 int ret;
883ad7684f17d2 Christian Marangi 2024-10-25 91
883ad7684f17d2 Christian Marangi 2024-10-25 92 if (!key || !keylen)
883ad7684f17d2 Christian Marangi 2024-10-25 93 return -EINVAL;
883ad7684f17d2 Christian Marangi 2024-10-25 94
883ad7684f17d2 Christian Marangi 2024-10-25 95 if (IS_RFC3686(flags)) {
883ad7684f17d2 Christian Marangi 2024-10-25 96 if (len < CTR_RFC3686_NONCE_SIZE)
883ad7684f17d2 Christian Marangi 2024-10-25 97 return -EINVAL;
883ad7684f17d2 Christian Marangi 2024-10-25 98
883ad7684f17d2 Christian Marangi 2024-10-25 99 keylen = len - CTR_RFC3686_NONCE_SIZE;
883ad7684f17d2 Christian Marangi 2024-10-25 100 memcpy(&nonce, key + keylen, CTR_RFC3686_NONCE_SIZE);
883ad7684f17d2 Christian Marangi 2024-10-25 101 }
883ad7684f17d2 Christian Marangi 2024-10-25 102
883ad7684f17d2 Christian Marangi 2024-10-25 103 if (flags & EIP93_ALG_DES) {
883ad7684f17d2 Christian Marangi 2024-10-25 104 ctx->blksize = DES_BLOCK_SIZE;
883ad7684f17d2 Christian Marangi 2024-10-25 105 ret = verify_skcipher_des_key(ctfm, key);
883ad7684f17d2 Christian Marangi 2024-10-25 106 }
883ad7684f17d2 Christian Marangi 2024-10-25 107 if (flags & EIP93_ALG_3DES) {
883ad7684f17d2 Christian Marangi 2024-10-25 108 ctx->blksize = DES3_EDE_BLOCK_SIZE;
883ad7684f17d2 Christian Marangi 2024-10-25 109 ret = verify_skcipher_des3_key(ctfm, key);
883ad7684f17d2 Christian Marangi 2024-10-25 110 }
883ad7684f17d2 Christian Marangi 2024-10-25 111
883ad7684f17d2 Christian Marangi 2024-10-25 112 if (flags & EIP93_ALG_AES) {
883ad7684f17d2 Christian Marangi 2024-10-25 113 struct crypto_aes_ctx aes;
883ad7684f17d2 Christian Marangi 2024-10-25 114
883ad7684f17d2 Christian Marangi 2024-10-25 115 ctx->blksize = AES_BLOCK_SIZE;
883ad7684f17d2 Christian Marangi 2024-10-25 116 ret = aes_expandkey(&aes, key, keylen);
883ad7684f17d2 Christian Marangi 2024-10-25 117 }
What about if none the flags are set?
883ad7684f17d2 Christian Marangi 2024-10-25 @118 if (ret)
883ad7684f17d2 Christian Marangi 2024-10-25 119 return ret;
883ad7684f17d2 Christian Marangi 2024-10-25 120
883ad7684f17d2 Christian Marangi 2024-10-25 121 eip93_set_sa_record(sa_record, keylen, flags);
883ad7684f17d2 Christian Marangi 2024-10-25 122
883ad7684f17d2 Christian Marangi 2024-10-25 123 memcpy(sa_record->sa_key, key, keylen);
883ad7684f17d2 Christian Marangi 2024-10-25 124 ctx->sa_nonce = nonce;
883ad7684f17d2 Christian Marangi 2024-10-25 125 sa_record->sa_nonce = nonce;
883ad7684f17d2 Christian Marangi 2024-10-25 126
883ad7684f17d2 Christian Marangi 2024-10-25 127 return 0;
883ad7684f17d2 Christian Marangi 2024-10-25 128 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists