[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210730031103.GE12121@gondor.apana.org.au>
Date: Fri, 30 Jul 2021 11:11:04 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Mian Yousaf Kaukab <ykaukab@...e.de>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
stefanb@...ux.ibm.com, davem@...emloft.net, tiwai@...e.de,
guillaume.gardet@....com
Subject: Re: [PATCH] crypto: ecc: handle unaligned input buffer in
ecc_swap_digits
On Wed, Jul 21, 2021 at 10:39:05AM +0200, Mian Yousaf Kaukab wrote:
> ecdsa_set_pub_key() makes an u64 pointer at 1 byte offset of the key.
> This results in an unaligned u64 pointer. This pointer is passed to
> ecc_swap_digits() which assumes natural alignment.
>
> This causes a kernel crash on an armv7 platform:
> [ 0.409022] Unhandled fault: alignment exception (0x001) at 0xc2a0a6a9
> ...
> [ 0.416982] PC is at ecdsa_set_pub_key+0xdc/0x120
> ...
> [ 0.491492] Backtrace:
> [ 0.492059] [<c07c266c>] (ecdsa_set_pub_key) from [<c07c75d4>] (test_akcipher_one+0xf4/0x6c0)
>
> Handle unaligned input buffer in ecc_swap_digits() by replacing
> be64_to_cpu() to get_unaligned_be64(). Change type of in pointer to
> void to reflect it doesn’t necessarily need to be aligned.
>
> Fixes: 4e6602916bc6 ("crypto: ecdsa - Add support for ECDSA signature verification")
> Reported-by: Guillaume Gardet <guillaume.gardet@....com>
> Suggested-by: Takashi Iwai <tiwai@...e.de>
> Signed-off-by: Mian Yousaf Kaukab <ykaukab@...e.de>
> ---
> crypto/ecc.h | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists