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>
This commit is contained in:
Paul Moore 2023-11-01 17:39:44 -04:00
parent d7cf3412a9
commit 4179320229
1 changed files with 1 additions and 1 deletions

View File

@ -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;