From: Paul Moore <paul@paul-moore.com>
To: linux-security-module@vger.kernel.org
Cc: "Mickaël Salaün" <mic@digikod.net>
Subject: [PATCH] lsm: update the BUILD_BUG_ON() in audit_log_lsm_data()
Date: Thu, 13 Aug 2026 14:08:17 -0400 [thread overview]
Message-ID: <20260813180816.223079-2-paul@paul-moore.com> (raw)
On 32-bit systems the newly added namespace fields in the
common_audit_data struct exceed the BUILD_BUG_ON(sizeof(void *) * 2)
size check in audit_log_lsm_data(). Convert the size check to two
u64 types to both fit the new fields and move to a size that is not
architecture dependent.
Fixes: bb20ca26f960 ("lsm: add LSM_AUDIT_DATA_NS for namespace audit records")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608131232.Owej9tlx-lkp@intel.com/
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
security/lsm_audit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 404ccbbbf94c..29116ef2986b 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -182,7 +182,7 @@ void audit_log_lsm_data(struct audit_buffer *ab,
* start making this union too large! See struct lsm_network_audit
* as an example of how to deal with large data.
*/
- BUILD_BUG_ON(sizeof(a->u) > sizeof(void *)*2);
+ BUILD_BUG_ON(sizeof(a->u) > (sizeof(u64) * 2));
switch (a->type) {
case LSM_AUDIT_DATA_NONE:
--
2.55.0
next reply other threads:[~2026-08-13 18:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 18:08 Paul Moore [this message]
2026-08-13 18:37 ` [PATCH] lsm: update the BUILD_BUG_ON() in audit_log_lsm_data() Paul Moore
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=20260813180816.223079-2-paul@paul-moore.com \
--to=paul@paul-moore.com \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
/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