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:
parent
d7cf3412a9
commit
4179320229
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue