Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 -1
+1 -1
security/security.c
··· 792 792 size_t nctx_len; 793 793 int rc = 0; 794 794 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 *)); 796 796 if (nctx_len > *uctx_len) { 797 797 rc = -E2BIG; 798 798 goto out;