mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* crypto/aes.c:38:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_cmac_key) <= CRYPTO_MINALIGN"
@ 2026-07-31  7:08 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-07-31  7:08 UTC (permalink / raw)
  To: Eric Biggers; +Cc: oe-kbuild-all, linux-kernel, Ard Biesheuvel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ba098e6b6ff0db8edf28528d1552be261af30d4
commit: 7137cbf2b5c9feb6302d6da116eab2047c5f05d2 crypto: aes - Add cmac, xcbc, and cbcmac algorithms using library
date:   5 months ago
config: powerpc-randconfig-r131-20260731 (https://download.01.org/0day-ci/archive/20260731/202607311436.r2LOv1zf-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 9.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260731/202607311436.r2LOv1zf-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
| Fixes: 7137cbf2b5c9 ("crypto: aes - Add cmac, xcbc, and cbcmac algorithms using library")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607311436.r2LOv1zf-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   crypto/aes.c:14:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_key) <= CRYPTO_MINALIGN"
>> crypto/aes.c:38:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_cmac_key) <= CRYPTO_MINALIGN"
>> crypto/aes.c:88:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_enckey) <= CRYPTO_MINALIGN"

vim +38 crypto/aes.c

    37	
  > 38	static_assert(__alignof__(struct aes_cmac_key) <= CRYPTO_MINALIGN);
    39	#define AES_CMAC_KEY(tfm) ((struct aes_cmac_key *)crypto_shash_ctx(tfm))
    40	#define AES_CMAC_CTX(desc) ((struct aes_cmac_ctx *)shash_desc_ctx(desc))
    41	
    42	static int __maybe_unused crypto_aes_cmac_setkey(struct crypto_shash *tfm,
    43							 const u8 *in_key,
    44							 unsigned int key_len)
    45	{
    46		return aes_cmac_preparekey(AES_CMAC_KEY(tfm), in_key, key_len);
    47	}
    48	
    49	static int __maybe_unused crypto_aes_xcbc_setkey(struct crypto_shash *tfm,
    50							 const u8 *in_key,
    51							 unsigned int key_len)
    52	{
    53		if (key_len != AES_KEYSIZE_128)
    54			return -EINVAL;
    55		aes_xcbcmac_preparekey(AES_CMAC_KEY(tfm), in_key);
    56		return 0;
    57	}
    58	
    59	static int __maybe_unused crypto_aes_cmac_init(struct shash_desc *desc)
    60	{
    61		aes_cmac_init(AES_CMAC_CTX(desc), AES_CMAC_KEY(desc->tfm));
    62		return 0;
    63	}
    64	
    65	static int __maybe_unused crypto_aes_cmac_update(struct shash_desc *desc,
    66							 const u8 *data,
    67							 unsigned int len)
    68	{
    69		aes_cmac_update(AES_CMAC_CTX(desc), data, len);
    70		return 0;
    71	}
    72	
    73	static int __maybe_unused crypto_aes_cmac_final(struct shash_desc *desc,
    74							u8 *out)
    75	{
    76		aes_cmac_final(AES_CMAC_CTX(desc), out);
    77		return 0;
    78	}
    79	
    80	static int __maybe_unused crypto_aes_cmac_digest(struct shash_desc *desc,
    81							 const u8 *data,
    82							 unsigned int len, u8 *out)
    83	{
    84		aes_cmac(AES_CMAC_KEY(desc->tfm), data, len, out);
    85		return 0;
    86	}
    87	
  > 88	static_assert(__alignof__(struct aes_enckey) <= CRYPTO_MINALIGN);
    89	#define AES_CBCMAC_KEY(tfm) ((struct aes_enckey *)crypto_shash_ctx(tfm))
    90	#define AES_CBCMAC_CTX(desc) ((struct aes_cbcmac_ctx *)shash_desc_ctx(desc))
    91	

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

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

* crypto/aes.c:38:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_cmac_key) <= CRYPTO_MINALIGN"
@ 2026-05-25  7:27 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-25  7:27 UTC (permalink / raw)
  To: Eric Biggers; +Cc: oe-kbuild-all, linux-kernel, Ard Biesheuvel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e7ae89a0c97ce2b68b0983cd01eda67cf373517d
commit: 7137cbf2b5c9feb6302d6da116eab2047c5f05d2 crypto: aes - Add cmac, xcbc, and cbcmac algorithms using library
date:   3 months ago
config: powerpc-randconfig-r113-20260525 (https://download.01.org/0day-ci/archive/20260525/202605251540.pExoRJXl-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 14.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260525/202605251540.pExoRJXl-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
| Fixes: 7137cbf2b5c9 ("crypto: aes - Add cmac, xcbc, and cbcmac algorithms using library")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605251540.pExoRJXl-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   crypto/aes.c:14:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_key) <= CRYPTO_MINALIGN"
>> crypto/aes.c:38:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_cmac_key) <= CRYPTO_MINALIGN"
>> crypto/aes.c:88:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_enckey) <= CRYPTO_MINALIGN"

vim +38 crypto/aes.c

    37	
  > 38	static_assert(__alignof__(struct aes_cmac_key) <= CRYPTO_MINALIGN);
    39	#define AES_CMAC_KEY(tfm) ((struct aes_cmac_key *)crypto_shash_ctx(tfm))
    40	#define AES_CMAC_CTX(desc) ((struct aes_cmac_ctx *)shash_desc_ctx(desc))
    41	
    42	static int __maybe_unused crypto_aes_cmac_setkey(struct crypto_shash *tfm,
    43							 const u8 *in_key,
    44							 unsigned int key_len)
    45	{
    46		return aes_cmac_preparekey(AES_CMAC_KEY(tfm), in_key, key_len);
    47	}
    48	
    49	static int __maybe_unused crypto_aes_xcbc_setkey(struct crypto_shash *tfm,
    50							 const u8 *in_key,
    51							 unsigned int key_len)
    52	{
    53		if (key_len != AES_KEYSIZE_128)
    54			return -EINVAL;
    55		aes_xcbcmac_preparekey(AES_CMAC_KEY(tfm), in_key);
    56		return 0;
    57	}
    58	
    59	static int __maybe_unused crypto_aes_cmac_init(struct shash_desc *desc)
    60	{
    61		aes_cmac_init(AES_CMAC_CTX(desc), AES_CMAC_KEY(desc->tfm));
    62		return 0;
    63	}
    64	
    65	static int __maybe_unused crypto_aes_cmac_update(struct shash_desc *desc,
    66							 const u8 *data,
    67							 unsigned int len)
    68	{
    69		aes_cmac_update(AES_CMAC_CTX(desc), data, len);
    70		return 0;
    71	}
    72	
    73	static int __maybe_unused crypto_aes_cmac_final(struct shash_desc *desc,
    74							u8 *out)
    75	{
    76		aes_cmac_final(AES_CMAC_CTX(desc), out);
    77		return 0;
    78	}
    79	
    80	static int __maybe_unused crypto_aes_cmac_digest(struct shash_desc *desc,
    81							 const u8 *data,
    82							 unsigned int len, u8 *out)
    83	{
    84		aes_cmac(AES_CMAC_KEY(desc->tfm), data, len, out);
    85		return 0;
    86	}
    87	
  > 88	static_assert(__alignof__(struct aes_enckey) <= CRYPTO_MINALIGN);
    89	#define AES_CBCMAC_KEY(tfm) ((struct aes_enckey *)crypto_shash_ctx(tfm))
    90	#define AES_CBCMAC_CTX(desc) ((struct aes_cbcmac_ctx *)shash_desc_ctx(desc))
    91	

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

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

end of thread, other threads:[~2026-07-31  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-31  7:08 crypto/aes.c:38:1: sparse: sparse: static assertion failed: "__alignof__(struct aes_cmac_key) <= CRYPTO_MINALIGN" kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-25  7:27 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®