Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: arnd@arndb.de, linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	herbert@gondor.apana.org.au
Subject: Re: [PATCH v2] crypto: reduce minimum alignment of on-stack structures
Date: Fri, 8 Jan 2021 13:16:36 -0800	[thread overview]
Message-ID: <X/jLtI1m96DD+QLO@sol.localdomain> (raw)
In-Reply-To: <20210108171706.10306-1-ardb@kernel.org>

On Fri, Jan 08, 2021 at 06:17:06PM +0100, Ard Biesheuvel wrote:
> diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h
> index 6a733b171a5d..aa133dc3bf39 100644
> --- a/include/crypto/skcipher.h
> +++ b/include/crypto/skcipher.h
> @@ -128,7 +128,7 @@ struct skcipher_alg {
>  			     MAX_SYNC_SKCIPHER_REQSIZE + \
>  			     (!(sizeof((struct crypto_sync_skcipher *)1 == \
>  				       (typeof(tfm))1))) \
> -			    ] CRYPTO_MINALIGN_ATTR; \
> +			    ] __aligned(ARCH_SLAB_MINALIGN); \
>  	struct skcipher_request *name = (void *)__##name##_desc
>  

Are you sure this is okay?  __alignof__(struct skcipher_request) will still be
CRYPTO_MINALIGN_ATTR, since it contains a field with that alignment.  So
technically isn't the full alignment still needed, as the compiler can assume
that struct skcipher_request is CRYPTO_MINALIGN_ATTR-aligned?

- Eric

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-01-08 21:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 17:17 [PATCH v2] crypto: reduce minimum alignment of on-stack structures Ard Biesheuvel
2021-01-08 21:16 ` Eric Biggers [this message]
2021-01-08 22:49   ` Ard Biesheuvel
2021-01-13  6:26     ` Herbert Xu
2021-01-13  8:18       ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X/jLtI1m96DD+QLO@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox