Skip to content

Commit 4179320

Browse files
committed
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>
1 parent d7cf341 commit 4179320

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

security/security.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, size_t *uctx_len,
792792
size_t nctx_len;
793793
int rc = 0;
794794

795-
nctx_len = ALIGN(struct_size(nctx, ctx, val_len), BITS_PER_LONG / 8);
795+
nctx_len = ALIGN(struct_size(nctx, ctx, val_len), sizeof(void *));
796796
if (nctx_len > *uctx_len) {
797797
rc = -E2BIG;
798798
goto out;

0 commit comments

Comments
 (0)