From: Adrian-Ken Rueegsegger <ken@codelabs.ch>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Matt Mackall <mpm@selenic.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
michael-dev@fami-braun.de, Pekka Enberg <penberg@cs.helsinki.fi>,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [BUG] SLOB breaks Crypto
Date: Tue, 18 May 2010 21:32:54 +0200 [thread overview]
Message-ID: <4BF2EB66.4020207@codelabs.ch> (raw)
In-Reply-To: <20100518102701.GA7293@gondor.apana.org.au>
Herbert Xu wrote:
> On Tue, May 18, 2010 at 10:17:35AM +0200, Adrian-Ken Rueegsegger wrote:
>> As noted in my other mail [1] it seems like the HMAC tests trigger these
>> errors.
>
> Thanks for all the detective work!
>
> I think the problem is this changeset:
>
> commit 6eb7228421c01ba48a6a88a7a5b3e71cfb70d4a9
> Author: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Tue Jan 8 17:16:44 2008 +1100
>
> [CRYPTO] api: Set default CRYPTO_MINALIGN to unsigned long long
>
> Thanks to David Miller for pointing out that the SLAB (or SLOB/SLUB)
> cache uses the alignment of unsigned long long if the architecture
> kmalloc/slab alignment macros are not defined.
>
> This patch changes the CRYPTO_MINALIGN so that it uses the same default
> value.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/include/linux/crypto.h b/include/linux/crypto.h
> index 0aba104..5e02d1b 100644
> --- a/include/linux/crypto.h
> +++ b/include/linux/crypto.h
> @@ -90,13 +90,11 @@
> #define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN
> #elif defined(ARCH_SLAB_MINALIGN)
> #define CRYPTO_MINALIGN ARCH_SLAB_MINALIGN
> +#else
> +#define CRYPTO_MINALIGN __alignof__(unsigned long long)
> #endif
>
> -#ifdef CRYPTO_MINALIGN
> #define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN)))
> -#else
> -#define CRYPTO_MINALIGN_ATTR
> -#endif
>
> struct scatterlist;
> struct crypto_ablkcipher;
>
> So evidently the assumption made in this change does not work on
> SLOB since it only guarantees __alignof__(unsigned long).
>
> I think the simplest fix is to revert this changeset.
When doing the revert it is necessary to either have
ARCH_KMALLOC_MINALIGN defined or explicitly define CRYPTO_MINALIGN in
the case where it is not. Otherwise shash compilation fails because it
needs CRYPTO_MINALIGN.
Regards,
Adrian
WARNING: multiple messages have this Message-ID (diff)
From: Adrian-Ken Rueegsegger <ken@codelabs.ch>
To: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: Matt Mackall <mpm@selenic.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
michael-dev@fami-braun.de, Pekka Enberg <penberg@cs.helsinki.fi>,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [BUG] SLOB breaks Crypto
Date: Tue, 18 May 2010 21:32:54 +0200 [thread overview]
Message-ID: <4BF2EB66.4020207@codelabs.ch> (raw)
In-Reply-To: <20100518102701.GA7293@gondor.apana.org.au>
Herbert Xu wrote:
> On Tue, May 18, 2010 at 10:17:35AM +0200, Adrian-Ken Rueegsegger wrote:
>> As noted in my other mail [1] it seems like the HMAC tests trigger these
>> errors.
>
> Thanks for all the detective work!
>
> I think the problem is this changeset:
>
> commit 6eb7228421c01ba48a6a88a7a5b3e71cfb70d4a9
> Author: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Tue Jan 8 17:16:44 2008 +1100
>
> [CRYPTO] api: Set default CRYPTO_MINALIGN to unsigned long long
>
> Thanks to David Miller for pointing out that the SLAB (or SLOB/SLUB)
> cache uses the alignment of unsigned long long if the architecture
> kmalloc/slab alignment macros are not defined.
>
> This patch changes the CRYPTO_MINALIGN so that it uses the same default
> value.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/include/linux/crypto.h b/include/linux/crypto.h
> index 0aba104..5e02d1b 100644
> --- a/include/linux/crypto.h
> +++ b/include/linux/crypto.h
> @@ -90,13 +90,11 @@
> #define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN
> #elif defined(ARCH_SLAB_MINALIGN)
> #define CRYPTO_MINALIGN ARCH_SLAB_MINALIGN
> +#else
> +#define CRYPTO_MINALIGN __alignof__(unsigned long long)
> #endif
>
> -#ifdef CRYPTO_MINALIGN
> #define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN)))
> -#else
> -#define CRYPTO_MINALIGN_ATTR
> -#endif
>
> struct scatterlist;
> struct crypto_ablkcipher;
>
> So evidently the assumption made in this change does not work on
> SLOB since it only guarantees __alignof__(unsigned long).
>
> I think the simplest fix is to revert this changeset.
When doing the revert it is necessary to either have
ARCH_KMALLOC_MINALIGN defined or explicitly define CRYPTO_MINALIGN in
the case where it is not. Otherwise shash compilation fails because it
needs CRYPTO_MINALIGN.
Regards,
Adrian
next prev parent reply other threads:[~2010-05-18 19:32 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-15 13:39 [BUG] SLOB breaks Crypto michael-dev
2010-03-18 16:30 ` Pekka Enberg
2010-03-18 21:24 ` michael-dev
2010-03-19 0:33 ` Herbert Xu
2010-05-14 14:50 ` Adrian-Ken Rueegsegger
2010-05-14 14:50 ` Adrian-Ken Rueegsegger
2010-05-17 16:17 ` Geert Uytterhoeven
2010-05-17 16:17 ` Geert Uytterhoeven
2010-05-17 21:50 ` Adrian-Ken Rueegsegger
2010-05-17 21:50 ` Adrian-Ken Rueegsegger
2010-05-17 22:37 ` Matt Mackall
2010-05-17 22:37 ` Matt Mackall
2010-05-18 8:17 ` Adrian-Ken Rueegsegger
2010-05-18 8:17 ` Adrian-Ken Rueegsegger
2010-05-18 10:27 ` Herbert Xu
2010-05-18 10:27 ` Herbert Xu
2010-05-18 14:02 ` Pekka Enberg
2010-05-18 14:02 ` Pekka Enberg
2010-05-18 19:06 ` Matt Mackall
2010-05-18 19:06 ` Matt Mackall
2010-05-18 19:25 ` David Miller
2010-05-18 19:25 ` David Miller
2010-05-18 19:33 ` Matt Mackall
2010-05-18 19:33 ` Matt Mackall
2010-05-18 20:59 ` David Miller
2010-05-18 20:59 ` David Miller
2010-05-18 21:15 ` Pekka Enberg
2010-05-18 21:15 ` Pekka Enberg
2010-05-18 21:20 ` David Miller
2010-05-18 21:20 ` David Miller
2010-05-18 22:35 ` Paul Mundt
2010-05-18 22:35 ` Paul Mundt
2010-05-18 22:37 ` Paul Mundt
2010-05-18 22:37 ` Paul Mundt
2010-05-19 15:19 ` Christoph Lameter
2010-05-19 19:56 ` David Miller
2010-05-18 22:40 ` David Miller
2010-05-18 22:40 ` David Miller
2010-05-18 23:10 ` Paul Mundt
2010-05-18 23:10 ` Paul Mundt
2010-05-18 23:16 ` Matt Mackall
2010-05-18 23:16 ` Matt Mackall
2010-05-19 5:53 ` Pekka Enberg
2010-05-19 5:53 ` Pekka Enberg
2010-05-18 23:20 ` David Woodhouse
2010-05-18 23:20 ` David Woodhouse
2010-05-19 1:05 ` Herbert Xu
2010-05-19 1:05 ` Herbert Xu
2010-05-19 7:14 ` David Woodhouse
2010-05-19 7:14 ` David Woodhouse
2010-05-19 7:45 ` Herbert Xu
2010-05-19 7:45 ` Herbert Xu
2010-05-19 11:32 ` Geert Uytterhoeven
2010-05-19 11:40 ` David Woodhouse
2010-05-19 11:50 ` Geert Uytterhoeven
2010-05-19 14:11 ` Matt Mackall
2010-05-19 19:33 ` David Miller
2010-05-20 3:38 ` FUJITA Tomonori
2010-05-20 3:46 ` David Miller
2010-05-19 12:02 ` FUJITA Tomonori
2010-05-19 12:19 ` David Woodhouse
2010-05-19 12:26 ` FUJITA Tomonori
2010-05-19 12:48 ` David Woodhouse
2010-05-19 10:58 ` David Woodhouse
2010-05-19 10:58 ` David Woodhouse
2010-05-19 11:01 ` [PATCH 1/4] mm: Move ARCH_SLAB_MINALIGN and ARCH_KMALLOC_MINALIGN to <linux/slab_def.h> David Woodhouse
2010-05-19 11:01 ` David Woodhouse
2010-05-19 13:30 ` Johannes Stezenbach
2010-05-19 13:30 ` Johannes Stezenbach
2010-05-19 18:03 ` Manfred Spraul
2010-05-19 18:10 ` David Woodhouse
2010-05-20 16:49 ` Manfred Spraul
2010-05-19 19:11 ` Pekka Enberg
2010-05-19 19:11 ` Pekka Enberg
2010-05-19 19:19 ` Christoph Lameter
2010-05-19 19:23 ` Pekka Enberg
2010-05-19 19:45 ` Christoph Lameter
2010-05-19 19:28 ` David Woodhouse
2010-05-19 11:01 ` [PATCH 2/4] mm: Move ARCH_SLAB_MINALIGN and ARCH_KMALLOC_MINALIGN to <linux/slob_def.h> David Woodhouse
2010-05-19 11:01 ` David Woodhouse
2010-05-19 11:02 ` [PATCH 3/4] mm: Move ARCH_SLAB_MINALIGN and ARCH_KMALLOC_MINALIGN to <linux/slub_def.h> David Woodhouse
2010-05-19 11:02 ` David Woodhouse
2010-05-19 11:02 ` [PATCH 4/4] crypto: Use ARCH_KMALLOC_MINALIGN for CRYPTO_MINALIGN now that it's exposed David Woodhouse
2010-05-19 11:02 ` David Woodhouse
2010-05-19 11:08 ` [BUG] SLOB breaks Crypto Pekka Enberg
2010-05-19 11:08 ` Pekka Enberg
2010-05-19 11:16 ` David Woodhouse
2010-05-19 11:16 ` David Woodhouse
2010-05-19 11:46 ` Herbert Xu
2010-05-19 11:46 ` Herbert Xu
2010-05-19 12:54 ` Pekka Enberg
2010-05-19 12:54 ` Pekka Enberg
2010-05-19 12:59 ` Herbert Xu
2010-05-19 12:59 ` Herbert Xu
2010-05-19 19:51 ` David Miller
2010-05-19 19:51 ` David Miller
2010-05-19 19:42 ` David Miller
2010-05-19 19:42 ` David Miller
2010-05-19 13:49 ` [PATCH 5/4] Provide __dma_aligned macro David Woodhouse
2010-05-19 13:49 ` David Woodhouse
2010-05-19 14:50 ` FUJITA Tomonori
2010-05-19 4:09 ` [BUG] SLOB breaks Crypto Herbert Xu
2010-05-19 4:09 ` Herbert Xu
2010-05-19 5:44 ` Pekka Enberg
2010-05-19 5:44 ` Pekka Enberg
2010-05-18 19:32 ` Adrian-Ken Rueegsegger [this message]
2010-05-18 19:32 ` Adrian-Ken Rueegsegger
2010-05-18 22:39 ` Herbert Xu
2010-05-18 22:39 ` Herbert Xu
2010-05-19 1:51 ` Herbert Xu
2010-05-19 1:51 ` Herbert Xu
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=4BF2EB66.4020207@codelabs.ch \
--to=ken@codelabs.ch \
--cc=anemo@mba.ocn.ne.jp \
--cc=davem@davemloft.net \
--cc=geert@linux-m68k.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael-dev@fami-braun.de \
--cc=mpm@selenic.com \
--cc=penberg@cs.helsinki.fi \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.