Mian Yousaf Kaukab
7f64bb5471
crypto: ecc - handle unaligned input buffer in ecc_swap_digits
...
[ Upstream commit 0469dede0e ]
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: 4e6602916b ("crypto: ecdsa - Add support for ECDSA signature verification")
Reported-by: Guillaume Gardet <guillaume.gardet@arm.com >
Suggested-by: Takashi Iwai <tiwai@suse.de >
Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de >
Tested-by: Stefan Berger <stefanb@linux.ibm.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-09-15 10:02:07 +02:00
..
2021-03-26 19:41:59 +11:00
2021-06-10 19:40:14 -07:00
2020-07-09 18:25:23 +10:00
2021-01-03 08:41:35 +11:00
2020-01-09 11:30:58 +08:00
2021-03-19 21:59:45 +11:00
2020-11-27 17:13:40 +11:00
2021-03-19 21:59:45 +11:00
2021-03-19 21:59:45 +11:00
2020-01-09 11:30:53 +08:00
2019-07-26 14:55:33 +10:00
2021-06-03 20:24:04 +08:00
2020-08-28 16:58:28 +10:00
2020-01-09 11:30:58 +08:00
2021-06-17 15:07:31 +08:00
2021-06-17 15:07:31 +08:00
2020-08-21 14:45:27 +10:00
2020-07-19 18:16:41 -07:00
2020-09-25 17:48:52 +10:00
2020-08-21 14:45:26 +10:00
2021-01-03 08:41:35 +11:00
2020-01-09 11:30:53 +08:00
2021-03-13 00:04:01 +11:00
2020-09-11 14:39:16 +10:00
2020-07-16 21:49:08 +10:00
2020-07-16 21:49:08 +10:00
2021-01-03 08:41:39 +11:00
2021-01-03 08:41:38 +11:00
2021-02-10 17:55:56 +11:00
2021-02-10 17:55:56 +11:00
2021-02-10 17:55:56 +11:00
2021-02-10 17:55:56 +11:00
2021-01-03 08:41:35 +11:00
2021-01-03 08:41:35 +11:00
2021-01-03 08:41:35 +11:00
2020-07-16 21:49:08 +10:00
2019-11-22 18:48:39 +08:00
2021-01-03 08:41:35 +11:00
2021-01-03 08:41:35 +11:00
2019-12-11 16:37:01 +08:00
2021-04-16 21:24:27 +10:00
2020-08-21 14:45:25 +10:00
2020-08-21 14:45:25 +10:00
2020-07-16 21:49:08 +10:00
2020-08-21 14:45:26 +10:00
2019-07-08 20:57:08 -07:00
2019-12-20 14:58:35 +08:00
2019-11-01 13:38:32 +08:00
2021-01-03 08:41:35 +11:00
2020-07-16 21:49:08 +10:00
2019-11-17 09:02:43 +08:00
2020-08-07 11:33:22 -07:00
2020-01-09 11:30:53 +08:00
2020-07-31 18:08:59 +10:00
2021-05-28 15:11:45 +08:00
2021-01-03 08:41:35 +11:00
2021-03-26 19:55:55 +11:00
2021-03-26 20:15:56 +11:00
2021-09-15 10:02:07 +02:00
2021-03-13 00:04:03 +11:00
2021-05-28 15:11:47 +08:00
2021-03-26 19:41:58 +11:00
2021-03-26 19:41:58 +11:00
2020-07-16 21:49:07 +10:00
2020-08-20 14:04:28 +10:00
2021-01-03 08:41:35 +11:00
2021-04-02 18:28:13 +11:00
2019-07-26 14:51:57 +10:00
2020-08-07 11:33:22 -07:00
2020-07-16 21:49:08 +10:00
2020-08-07 11:33:22 -07:00
2020-01-09 11:30:53 +08:00
2020-02-18 07:35:49 -05:00
2020-07-16 21:49:08 +10:00
2021-06-24 14:51:35 +08:00
2020-08-20 14:04:28 +10:00
2021-03-26 20:02:35 +11:00
2019-10-18 18:49:40 +11:00
2021-07-16 15:49:31 +08:00
2021-04-02 18:28:13 +11:00
2021-05-28 15:11:44 +08:00
2020-07-23 17:34:20 +10:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2021-03-26 19:41:58 +11:00
2019-06-13 14:31:39 +08:00
2020-02-28 08:43:21 +08:00
2021-02-10 17:55:55 +11:00
2020-01-16 15:18:12 +08:00
2021-01-03 08:41:35 +11:00
2021-01-03 08:41:35 +11:00
2020-07-23 17:34:18 +10:00
2020-01-16 15:18:12 +08:00
2020-09-25 17:48:15 +10:00
2021-01-29 16:07:04 +11:00
2019-07-08 20:57:08 -07:00
2021-04-02 18:28:12 +11:00
2020-08-20 14:04:28 +10:00
2019-12-20 14:58:35 +08:00
2020-12-04 18:13:16 +11:00
2020-08-07 11:33:22 -07:00
2021-03-07 15:13:15 +11:00
2020-11-20 14:45:33 +11:00
2020-07-23 17:34:20 +10:00
2020-11-20 14:45:33 +11:00
2020-11-20 14:45:33 +11:00
2021-06-17 15:07:31 +08:00
2020-07-16 21:49:08 +10:00
2021-01-14 17:10:29 +11:00
2021-06-11 15:03:30 +08:00
2020-09-25 17:48:54 +10:00
2020-09-25 17:48:53 +10:00
2020-01-09 11:30:53 +08:00
2019-08-15 21:52:14 +10:00
2021-09-15 10:02:05 +02:00
2020-08-21 14:45:27 +10:00
2019-07-08 20:57:08 -07:00
2021-06-28 11:28:08 +08:00
2021-06-28 11:28:08 +08:00
2020-01-09 11:30:53 +08:00
2021-02-10 17:55:57 +11:00
2021-01-03 08:41:35 +11:00
2021-05-28 15:11:44 +08:00
2021-01-03 08:41:35 +11:00
2021-02-21 17:23:56 -08:00
2021-01-03 08:41:35 +11:00
2020-01-09 11:30:53 +08:00
2020-08-07 11:33:22 -07:00