linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: x86/polyval - Fix crashes when keys are not 16-byte aligned
@ 2022-10-17 22:26 Nathan Huckleberry
  2022-10-17 23:02 ` Eric Biggers
  0 siblings, 1 reply; 11+ messages in thread
From: Nathan Huckleberry @ 2022-10-17 22:26 UTC (permalink / raw)
  Cc: Nathan Huckleberry, Bruno Goncalves, Herbert Xu, David S. Miller,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Eric Biggers, Ard Biesheuvel, linux-crypto,
	linux-kernel

The key_powers array is not guaranteed to be 16-byte aligned, so using
movaps to operate on key_powers is not allowed.

Switch movaps to movups.

Fixes: 34f7f6c30112 ("crypto: x86/polyval - Add PCLMULQDQ accelerated implementation of POLYVAL")
Reported-by: Bruno Goncalves <bgoncalv@redhat.com>
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
---
 arch/x86/crypto/polyval-clmulni_asm.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/crypto/polyval-clmulni_asm.S b/arch/x86/crypto/polyval-clmulni_asm.S
index a6ebe4e7dd2b..32b98cb53ddf 100644
--- a/arch/x86/crypto/polyval-clmulni_asm.S
+++ b/arch/x86/crypto/polyval-clmulni_asm.S
@@ -234,7 +234,7 @@
 
 	movups (MSG), %xmm0
 	pxor SUM, %xmm0
-	movaps (KEY_POWERS), %xmm1
+	movups (KEY_POWERS), %xmm1
 	schoolbook1_noload
 	dec BLOCKS_LEFT
 	addq $16, MSG
-- 
2.38.0.413.g74048e4d9e-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-10-21 11:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 22:26 [PATCH] crypto: x86/polyval - Fix crashes when keys are not 16-byte aligned Nathan Huckleberry
2022-10-17 23:02 ` Eric Biggers
2022-10-17 23:38   ` Nathan Huckleberry
2022-10-18  0:12     ` Eric Biggers
2022-10-18  4:03       ` Herbert Xu
2022-10-18 21:56         ` [PATCH v2] " Nathan Huckleberry
2022-10-18 22:39           ` Eric Biggers
2022-10-18 23:04             ` [PATCH v3] " Nathan Huckleberry
2022-10-18 23:12               ` Eric Biggers
2022-10-19 12:13               ` Bruno Goncalves
2022-10-21 11:39               ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).