summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2023-11-01 17:39:44 -0400
committerPaul Moore <paul@paul-moore.com>2023-11-12 22:54:42 -0500
commit41793202292fd2acf99fdc09eff8323cc27c80eb (patch)
tree937394ddc055ac7ebca91f5975777d211e2cb7a9 /security
parentd7cf3412a9f6c547e5ee443fa7644e08898aa3e2 (diff)
downloadlinux-41793202292fd2acf99fdc09eff8323cc27c80eb.tar.gz
linux-41793202292fd2acf99fdc09eff8323cc27c80eb.tar.bz2
linux-41793202292fd2acf99fdc09eff8323cc27c80eb.zip
lsm: align based on pointer length in lsm_fill_user_ctx()
Using the size of a void pointer is much cleaner than BITS_PER_LONG / 8. Acked-by: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r--security/security.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/security.c b/security/security.c
index 86f7a1995991..a808fd5eba6d 100644
--- a/security/security.c
+++ b/security/security.c
@@ -792,7 +792,7 @@ int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, size_t *uctx_len,
size_t nctx_len;
int rc = 0;
- nctx_len = ALIGN(struct_size(nctx, ctx, val_len), BITS_PER_LONG / 8);
+ nctx_len = ALIGN(struct_size(nctx, ctx, val_len), sizeof(void *));
if (nctx_len > *uctx_len) {
rc = -E2BIG;
goto out;