Commit 41793202 authored by Paul Moore's avatar Paul Moore

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: default avatarCasey Schaufler <casey@schaufler-ca.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent d7cf3412
...@@ -792,7 +792,7 @@ int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, size_t *uctx_len, ...@@ -792,7 +792,7 @@ int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, size_t *uctx_len,
size_t nctx_len; size_t nctx_len;
int rc = 0; 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) { if (nctx_len > *uctx_len) {
rc = -E2BIG; rc = -E2BIG;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment