From: kernel test robot <lkp@intel.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [gustavoars:testing/wfamnae-next20250814 2/8] security/integrity/integrity.h:37:67: error: invalid application of 'sizeof' to incomplete type 'struct evm_ima_xattr_data_hdr'
Date: Fri, 29 Aug 2025 23:52:12 +0800 [thread overview]
Message-ID: <202508292352.Q9sA9NNG-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/wfamnae-next20250814
head: 4774a38f9cf278ece929331bdef17ab5db24684c
commit: c2ca48406d8d7e98ac35251db90286b3b86f01c1 [2/8] Revert "integrity: Avoid -Wflex-array-member-not-at-end warnings"
config: csky-randconfig-001-20250829 (https://download.01.org/0day-ci/archive/20250829/202508292352.Q9sA9NNG-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 9.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250829/202508292352.Q9sA9NNG-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/202508292352.Q9sA9NNG-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/key.h:14,
from include/linux/security.h:27,
from security/integrity/iint.c:12:
>> security/integrity/integrity.h:37:67: error: invalid application of 'sizeof' to incomplete type 'struct evm_ima_xattr_data_hdr'
37 | static_assert(offsetof(struct evm_ima_xattr_data, data) == sizeof(struct evm_ima_xattr_data_hdr),
| ^~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
security/integrity/integrity.h:37:1: note: in expansion of macro 'static_assert'
37 | static_assert(offsetof(struct evm_ima_xattr_data, data) == sizeof(struct evm_ima_xattr_data_hdr),
| ^~~~~~~~~~~~~
>> include/linux/stddef.h:16:32: error: expression in static assertion is not an integer
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
security/integrity/integrity.h:37:1: note: in expansion of macro 'static_assert'
37 | static_assert(offsetof(struct evm_ima_xattr_data, data) == sizeof(struct evm_ima_xattr_data_hdr),
| ^~~~~~~~~~~~~
security/integrity/integrity.h:37:15: note: in expansion of macro 'offsetof'
37 | static_assert(offsetof(struct evm_ima_xattr_data, data) == sizeof(struct evm_ima_xattr_data_hdr),
| ^~~~~~~~
>> security/integrity/integrity.h:64:66: error: invalid application of 'sizeof' to incomplete type 'struct ima_digest_data_hdr'
64 | static_assert(offsetof(struct ima_digest_data, digest) == sizeof(struct ima_digest_data_hdr),
| ^~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
security/integrity/integrity.h:64:1: note: in expansion of macro 'static_assert'
64 | static_assert(offsetof(struct ima_digest_data, digest) == sizeof(struct ima_digest_data_hdr),
| ^~~~~~~~~~~~~
>> include/linux/stddef.h:16:32: error: expression in static assertion is not an integer
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
security/integrity/integrity.h:64:1: note: in expansion of macro 'static_assert'
64 | static_assert(offsetof(struct ima_digest_data, digest) == sizeof(struct ima_digest_data_hdr),
| ^~~~~~~~~~~~~
security/integrity/integrity.h:64:15: note: in expansion of macro 'offsetof'
64 | static_assert(offsetof(struct ima_digest_data, digest) == sizeof(struct ima_digest_data_hdr),
| ^~~~~~~~
vim +37 security/integrity/integrity.h
6be5cc5246f807f Dmitry Kasatkin 2011-03-09 32
6be5cc5246f807f Dmitry Kasatkin 2011-03-09 33 struct evm_ima_xattr_data {
6be5cc5246f807f Dmitry Kasatkin 2011-03-09 34 u8 type;
650b29dbdf2caf7 Thiago Jung Bauermann 2019-06-11 35 u8 data[];
650b29dbdf2caf7 Thiago Jung Bauermann 2019-06-11 36 } __packed;
08ae3e5f5fc8edb Gustavo A. R. Silva 2024-08-08 @37 static_assert(offsetof(struct evm_ima_xattr_data, data) == sizeof(struct evm_ima_xattr_data_hdr),
08ae3e5f5fc8edb Gustavo A. R. Silva 2024-08-08 38 "struct member likely outside of __struct_group()");
650b29dbdf2caf7 Thiago Jung Bauermann 2019-06-11 39
650b29dbdf2caf7 Thiago Jung Bauermann 2019-06-11 40 /* Only used in the EVM HMAC code. */
650b29dbdf2caf7 Thiago Jung Bauermann 2019-06-11 41 struct evm_xattr {
c2ca48406d8d7e9 Gustavo A. R. Silva 2025-08-22 42 struct evm_ima_xattr_data data;
6be5cc5246f807f Dmitry Kasatkin 2011-03-09 43 u8 digest[SHA1_DIGEST_SIZE];
c7c8bb237fdbff9 Dmitry Kasatkin 2013-04-25 44 } __packed;
c7c8bb237fdbff9 Dmitry Kasatkin 2013-04-25 45
398c42e2c46c88b Mimi Zohar 2021-11-24 46 #define IMA_MAX_DIGEST_SIZE HASH_MAX_DIGESTSIZE
c7c8bb237fdbff9 Dmitry Kasatkin 2013-04-25 47
c7c8bb237fdbff9 Dmitry Kasatkin 2013-04-25 48 struct ima_digest_data {
c7c8bb237fdbff9 Dmitry Kasatkin 2013-04-25 49 u8 algo;
c7c8bb237fdbff9 Dmitry Kasatkin 2013-04-25 50 u8 length;
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 51 union {
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 52 struct {
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 53 u8 unused;
c7c8bb237fdbff9 Dmitry Kasatkin 2013-04-25 54 u8 type;
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 55 } sha1;
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 56 struct {
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 57 u8 type;
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 58 u8 algo;
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 59 } ng;
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 60 u8 data[2];
3ea7a56067e6632 Dmitry Kasatkin 2013-08-12 61 } xattr;
eb492c627a61b56 Gustavo A. R. Silva 2020-05-28 62 u8 digest[];
c7c8bb237fdbff9 Dmitry Kasatkin 2013-04-25 63 } __packed;
08ae3e5f5fc8edb Gustavo A. R. Silva 2024-08-08 @64 static_assert(offsetof(struct ima_digest_data, digest) == sizeof(struct ima_digest_data_hdr),
08ae3e5f5fc8edb Gustavo A. R. Silva 2024-08-08 65 "struct member likely outside of __struct_group()");
6be5cc5246f807f Dmitry Kasatkin 2011-03-09 66
:::::: The code at line 37 was first introduced by commit
:::::: 08ae3e5f5fc8edb9bd0c7ef9696ff29ef18b26ef integrity: Use static_assert() to check struct sizes
:::::: TO: Gustavo A. R. Silva <gustavoars@kernel.org>
:::::: CC: Mimi Zohar <zohar@linux.ibm.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-08-29 15:53 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=202508292352.Q9sA9NNG-lkp@intel.com \
--to=lkp@intel.com \
--cc=gustavo@embeddedor.com \
--cc=gustavoars@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®