lsm: align based on pointer length in lsm_fill_user_ctx()
Paul Moore
maintainerPATCH 1/1 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.
Signed-off-by Paul Moore <[email protected]>
--- security/security.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/security.c +1 -1
@@ -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;
Signature · 1 line
2.42.0
Quoted 4 lines · Paul Moore
Using the size of a void pointer is much cleaner than
BITS_PER_LONG/ 8.Signed-off-by Paul Moore <[email protected]>
Acked-by Casey Schaufler <[email protected]>
Quoted 17 lines
--- security/security.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/security.c +1
-1@@ -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;
Quoted 8 lines · Paul Moore
Using the size of a void pointer is much cleaner than
BITS_PER_LONG/ 8.Signed-off-by Paul Moore <[email protected]>--- security/security.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Merged into lsm/dev-staging.
Signature · 1 line
paul-moore.com
Paul Moore
maintainerQuoted 6 lines · Paul Moore
Quoted 4 lines · Paul Moore
Using the size of a void pointer is much cleaner than
BITS_PER_LONG/ 8.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Paul Moore <[email protected]>--- security/security.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Merged into lsm/dev-staging.
Now merged into lsm/dev.
Signature · 1 line
paul-moore.com