linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224
@ 2023-10-28 16:54 kernel test robot
  2023-11-17 10:22 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-10-28 16:54 UTC (permalink / raw)
  To: Danny Tsen; +Cc: oe-kbuild-all, linux-kernel, Herbert Xu

Hi Danny,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   56567a20b22bdbf85c3e55eee3bf2bd23fa2f108
commit: 9c716e1bd369afa2d1c5038297e8ceda3f82db7d crypto: p10-aes-gcm - Remove POWER10_CPU dependency
date:   6 months ago
config: powerpc64-randconfig-r005-20230913 (https://download.01.org/0day-ci/archive/20231029/202310290004.TQsw1iN1-lkp@intel.com/config)
compiler: powerpc64le-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231029/202310290004.TQsw1iN1-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/202310290004.TQsw1iN1-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/powerpc/crypto/aes-gcm-p10-glue.c: In function 'gcmp10_init':
>> arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224 [-Werror=stringop-overflow=]
     121 |         gcm_init_htable(hash->Htable+32, hash->H);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: note: referencing argument 1 of type 'unsigned char[256]'
   arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: note: referencing argument 2 of type 'unsigned char[16]'
   arch/powerpc/crypto/aes-gcm-p10-glue.c:41:17: note: in a call to function 'gcm_init_htable'
      41 | asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]);
         |                 ^~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +/gcm_init_htable +121 arch/powerpc/crypto/aes-gcm-p10-glue.c

cdcecfd9991fe9a Danny Tsen 2023-02-20  113  
cdcecfd9991fe9a Danny Tsen 2023-02-20  114  static void gcmp10_init(struct gcm_ctx *gctx, u8 *iv, unsigned char *rdkey,
cdcecfd9991fe9a Danny Tsen 2023-02-20  115  			struct Hash_ctx *hash, u8 *assoc, unsigned int assoclen)
cdcecfd9991fe9a Danny Tsen 2023-02-20  116  {
cdcecfd9991fe9a Danny Tsen 2023-02-20  117  	__be32 counter = cpu_to_be32(1);
cdcecfd9991fe9a Danny Tsen 2023-02-20  118  
cdcecfd9991fe9a Danny Tsen 2023-02-20  119  	aes_p8_encrypt(hash->H, hash->H, rdkey);
cdcecfd9991fe9a Danny Tsen 2023-02-20  120  	set_subkey(hash->H);
cdcecfd9991fe9a Danny Tsen 2023-02-20 @121  	gcm_init_htable(hash->Htable+32, hash->H);
cdcecfd9991fe9a Danny Tsen 2023-02-20  122  
cdcecfd9991fe9a Danny Tsen 2023-02-20  123  	*((__be32 *)(iv+12)) = counter;
cdcecfd9991fe9a Danny Tsen 2023-02-20  124  
cdcecfd9991fe9a Danny Tsen 2023-02-20  125  	gctx->Plen = 0;
cdcecfd9991fe9a Danny Tsen 2023-02-20  126  
cdcecfd9991fe9a Danny Tsen 2023-02-20  127  	/*
cdcecfd9991fe9a Danny Tsen 2023-02-20  128  	 * Encrypt counter vector as iv tag and increment counter.
cdcecfd9991fe9a Danny Tsen 2023-02-20  129  	 */
cdcecfd9991fe9a Danny Tsen 2023-02-20  130  	aes_p8_encrypt(iv, gctx->ivtag, rdkey);
cdcecfd9991fe9a Danny Tsen 2023-02-20  131  
cdcecfd9991fe9a Danny Tsen 2023-02-20  132  	counter = cpu_to_be32(2);
cdcecfd9991fe9a Danny Tsen 2023-02-20  133  	*((__be32 *)(iv+12)) = counter;
cdcecfd9991fe9a Danny Tsen 2023-02-20  134  	memcpy(gctx->iv, iv, 16);
cdcecfd9991fe9a Danny Tsen 2023-02-20  135  
cdcecfd9991fe9a Danny Tsen 2023-02-20  136  	gctx->aadLen = assoclen;
cdcecfd9991fe9a Danny Tsen 2023-02-20  137  	memset(gctx->aad_hash, 0, 16);
cdcecfd9991fe9a Danny Tsen 2023-02-20  138  	if (assoclen)
cdcecfd9991fe9a Danny Tsen 2023-02-20  139  		set_aad(gctx, hash, assoc, assoclen);
cdcecfd9991fe9a Danny Tsen 2023-02-20  140  }
cdcecfd9991fe9a Danny Tsen 2023-02-20  141  

:::::: The code at line 121 was first introduced by commit
:::::: cdcecfd9991fe9aac8160a9731b0ffd1e702d19d crypto: p10-aes-gcm - Glue code for AES/GCM stitched implementation

:::::: TO: Danny Tsen <dtsen@linux.ibm.com>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

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

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

* Re: arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224
  2023-10-28 16:54 arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224 kernel test robot
@ 2023-11-17 10:22 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2023-11-17 10:22 UTC (permalink / raw)
  To: kernel test robot
  Cc: Danny Tsen, oe-kbuild-all, linux-kernel, Linux Crypto Mailing List

On Sun, Oct 29, 2023 at 12:54:22AM +0800, kernel test robot wrote:
>
>    arch/powerpc/crypto/aes-gcm-p10-glue.c: In function 'gcmp10_init':
> >> arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224 [-Werror=stringop-overflow=]
>      121 |         gcm_init_htable(hash->Htable+32, hash->H);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: note: referencing argument 1 of type 'unsigned char[256]'
>    arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: note: referencing argument 2 of type 'unsigned char[16]'
>    arch/powerpc/crypto/aes-gcm-p10-glue.c:41:17: note: in a call to function 'gcm_init_htable'
>       41 | asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]);
>          |                 ^~~~~~~~~~~~~~~
>    cc1: all warnings being treated as errors

Danny, can you please look into this error?

Perhaps htable should be changed to 224?

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2023-11-17 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-28 16:54 arch/powerpc/crypto/aes-gcm-p10-glue.c:121:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224 kernel test robot
2023-11-17 10:22 ` Herbert Xu

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).