netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: T Pratham <t-pratham@ti.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	netdev@vger.kernel.org, Kamlesh Gurudasani <kamlesh@ti.com>,
	Manorit Chawdhry <m-chawdhry@ti.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Praneeth Bajjuri <praneeth@ti.com>,
	Vishal Mahaveer <vishalm@ti.com>,
	Kavitha Malarvizhi <k-malarvizhi@ti.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] crypto: ti: Add support for AES-CCM in DTHEv2 driver
Date: Sun, 7 Sep 2025 03:21:49 +0800	[thread overview]
Message-ID: <202509070251.7MfOWGUB-lkp@intel.com> (raw)
In-Reply-To: <20250905133504.2348972-8-t-pratham@ti.com>

Hi Pratham,

kernel test robot noticed the following build warnings:

[auto build test WARNING on herbert-cryptodev-2.6/master]
[also build test WARNING on next-20250905]
[cannot apply to herbert-crypto-2.6/master linus/master v6.17-rc4]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/T-Pratham/crypto-ti-Add-support-for-AES-XTS-in-DTHEv2-driver/20250905-214245
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link:    https://lore.kernel.org/r/20250905133504.2348972-8-t-pratham%40ti.com
patch subject: [PATCH 4/4] crypto: ti: Add support for AES-CCM in DTHEv2 driver
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20250907/202509070251.7MfOWGUB-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250907/202509070251.7MfOWGUB-lkp@intel.com/reproduce)

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509070251.7MfOWGUB-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/crypto/ti/dthev2-aes.c:818:7: warning: variable 'unpadded_cryptlen' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     818 |                 if (!dst) {
         |                     ^~~~
   drivers/crypto/ti/dthev2-aes.c:962:6: note: uninitialized use occurs here
     962 |         if (unpadded_cryptlen % AES_BLOCK_SIZE)
         |             ^~~~~~~~~~~~~~~~~
   drivers/crypto/ti/dthev2-aes.c:818:3: note: remove the 'if' if its condition is always false
     818 |                 if (!dst) {
         |                 ^~~~~~~~~~~
     819 |                         ret = -ENOMEM;
         |                         ~~~~~~~~~~~~~~
     820 |                         goto aead_prep_dst_err;
         |                         ~~~~~~~~~~~~~~~~~~~~~~~
     821 |                 }
         |                 ~
   drivers/crypto/ti/dthev2-aes.c:779:32: note: initialize the variable 'unpadded_cryptlen' to silence this warning
     779 |         unsigned int unpadded_cryptlen;
         |                                       ^
         |                                        = 0
>> drivers/crypto/ti/dthev2-aes.c:995:49: warning: result of comparison of constant 2305843009213693951 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare]
     995 |             (ctx->aes_mode == DTHE_AES_CCM && cryptlen > DTHE_AES_CCM_CRYPT_MAXLEN)) {
         |                                               ~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
   2 warnings generated.


vim +995 drivers/crypto/ti/dthev2-aes.c

   973	
   974	static int dthe_aead_crypt(struct aead_request *req)
   975	{
   976		struct dthe_tfm_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
   977		struct dthe_aes_req_ctx *rctx = aead_request_ctx(req);
   978		struct dthe_data *dev_data = dthe_get_dev(ctx);
   979		struct crypto_engine *engine;
   980		unsigned int cryptlen = req->cryptlen;
   981	
   982		// In decryption, last authsize bytes are the TAG
   983		if (!rctx->enc)
   984			cryptlen -= ctx->authsize;
   985	
   986		/* Need to fallback to software in the following cases due to HW restrictions:
   987		 * - Both AAD and plaintext/ciphertext are zero length
   988		 * - For AES-GCM, AAD length is more than 2^32 - 1 bytes
   989		 * - For AES-CCM, AAD length is more than 2^16 - 2^8 bytes
   990		 * - For AES-CCM, ciphertext length is more than 2^61 - 1 bytes
   991		 */
   992		if ((req->assoclen == 0 && cryptlen == 0) ||
   993		    (ctx->aes_mode == DTHE_AES_GCM && req->assoclen > DTHE_AES_GCM_AAD_MAXLEN) ||
   994		    (ctx->aes_mode == DTHE_AES_CCM && req->assoclen > DTHE_AES_CCM_AAD_MAXLEN) ||
 > 995		    (ctx->aes_mode == DTHE_AES_CCM && cryptlen > DTHE_AES_CCM_CRYPT_MAXLEN)) {
   996			struct aead_request *subreq = &rctx->fb_req;
   997			int ret;
   998	
   999			aead_request_set_tfm(subreq, ctx->aead_fb);
  1000			aead_request_set_callback(subreq, req->base.flags,
  1001						  req->base.complete, req->base.data);
  1002			aead_request_set_crypt(subreq, req->src, req->dst,
  1003					       req->cryptlen, req->iv);
  1004			aead_request_set_ad(subreq, req->assoclen);
  1005	
  1006			ret = rctx->enc ? crypto_aead_encrypt(subreq) :
  1007				crypto_aead_decrypt(subreq);
  1008	
  1009			return ret;
  1010		}
  1011	
  1012		engine = dev_data->engine;
  1013		return crypto_transfer_aead_request_to_engine(engine, req);
  1014	}
  1015	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

           reply	other threads:[~2025-09-06 19:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20250905133504.2348972-8-t-pratham@ti.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202509070251.7MfOWGUB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=k-malarvizhi@ti.com \
    --cc=kamlesh@ti.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=m-chawdhry@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=praneeth@ti.com \
    --cc=t-pratham@ti.com \
    --cc=vigneshr@ti.com \
    --cc=vishalm@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).