From: kernel test robot <lkp@intel.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [ebiggers:libcrypto-pending 38/50] crypto/sha1.c:23:15: error: static assertion failed due to requirement 'sizeof(struct sha1_ctx) == sizeof(struct sha1_state)': sizeof(struct sha1_ctx) == sizeof(struct sha1_state)
Date: Sat, 21 Mar 2026 17:55:36 +0800 [thread overview]
Message-ID: <202603211729.eY5qHyS4-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git libcrypto-pending
head: 68eff526dd94e97b9b25a9c01865062bc99264b0
commit: 06e5e9868540eb7be8630b1466d1571b52f3c82f [38/50] lib/crypto: sha1: Explicitly specify alignment of sha1_ctx::buf
config: i386-randconfig-013-20260321 (https://download.01.org/0day-ci/archive/20260321/202603211729.eY5qHyS4-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260321/202603211729.eY5qHyS4-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/202603211729.eY5qHyS4-lkp@intel.com/
All errors (new ones prefixed by >>):
>> crypto/sha1.c:23:15: error: static assertion failed due to requirement 'sizeof(struct sha1_ctx) == sizeof(struct sha1_state)': sizeof(struct sha1_ctx) == sizeof(struct sha1_state)
23 | static_assert(sizeof(struct sha1_ctx) == sizeof(struct sha1_state));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
crypto/sha1.c:23:39: note: expression evaluates to '96 == 92'
23 | static_assert(sizeof(struct sha1_ctx) == sizeof(struct sha1_state));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
>> crypto/sha1.c:26:15: error: static assertion failed due to requirement '__builtin_offsetof(struct sha1_ctx, buf) == __builtin_offsetof(struct sha1_state, buffer)': offsetof(struct sha1_ctx, buf) == offsetof(struct sha1_state, buffer)
26 | static_assert(offsetof(struct sha1_ctx, buf) == offsetof(struct sha1_state, buffer));
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
crypto/sha1.c:26:46: note: expression evaluates to '32 == 28'
26 | static_assert(offsetof(struct sha1_ctx, buf) == offsetof(struct sha1_state, buffer));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
2 errors generated.
vim +23 crypto/sha1.c
8bc79ab67d78e2 Eric Biggers 2025-07-12 14
b10a74abcfc5c6 Eric Biggers 2025-07-12 15 /*
b10a74abcfc5c6 Eric Biggers 2025-07-12 16 * Export and import functions. crypto_shash wants a particular format that
b10a74abcfc5c6 Eric Biggers 2025-07-12 17 * matches that used by some legacy drivers. It currently is the same as the
b10a74abcfc5c6 Eric Biggers 2025-07-12 18 * library SHA context, except the value in bytecount must be block-aligned and
b10a74abcfc5c6 Eric Biggers 2025-07-12 19 * the remainder must be stored in an extra u8 appended to the struct.
b10a74abcfc5c6 Eric Biggers 2025-07-12 20 */
b10a74abcfc5c6 Eric Biggers 2025-07-12 21
b10a74abcfc5c6 Eric Biggers 2025-07-12 22 #define SHA1_SHASH_STATE_SIZE (sizeof(struct sha1_ctx) + 1)
b10a74abcfc5c6 Eric Biggers 2025-07-12 @23 static_assert(sizeof(struct sha1_ctx) == sizeof(struct sha1_state));
b10a74abcfc5c6 Eric Biggers 2025-07-12 24 static_assert(offsetof(struct sha1_ctx, state) == offsetof(struct sha1_state, state));
b10a74abcfc5c6 Eric Biggers 2025-07-12 25 static_assert(offsetof(struct sha1_ctx, bytecount) == offsetof(struct sha1_state, count));
b10a74abcfc5c6 Eric Biggers 2025-07-12 @26 static_assert(offsetof(struct sha1_ctx, buf) == offsetof(struct sha1_state, buffer));
b10a74abcfc5c6 Eric Biggers 2025-07-12 27
:::::: The code at line 23 was first introduced by commit
:::::: b10a74abcfc5c61afc63a567c457038be57eeb6e crypto: sha1 - Use same state format as legacy drivers
:::::: TO: Eric Biggers <ebiggers@kernel.org>
:::::: CC: Eric Biggers <ebiggers@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-03-21 9:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202603211729.eY5qHyS4-lkp@intel.com \
--to=lkp@intel.com \
--cc=ebiggers@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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