linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: add missing kernel_fpu_end() call
@ 2021-07-30 13:41 Shreyansh Chouhan
  2021-08-06  8:23 ` Herbert Xu
  0 siblings, 1 reply; 14+ messages in thread
From: Shreyansh Chouhan @ 2021-07-30 13:41 UTC (permalink / raw)
  To: herbert, davem, tglx, mingo, bp, x86, hpa
  Cc: Shreyansh Chouhan, linux-crypto, linux-kernel,
	syzbot+20191dc583eff8602d2d

xts_crypt() code doesn't call kernel_fpu_end() after calling
kernel_fpu_begin() if walk.nbytes is 0. Add a call to kernel_fpu_end()
for this case.

Reported-by: syzbot+20191dc583eff8602d2d@syzkaller.appspotmail.com
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
---
 arch/x86/crypto/aesni-intel_glue.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index 2144e54a6c89..bd55a0cd7bde 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -894,6 +894,9 @@ static int xts_crypt(struct skcipher_request *req, bool encrypt)
 			kernel_fpu_begin();
 	}
 
+	if (walk.nbytes == 0)
+		kernel_fpu_end();
+
 	if (unlikely(tail > 0 && !err)) {
 		struct scatterlist sg_src[2], sg_dst[2];
 		struct scatterlist *src, *dst;
-- 
2.31.1


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

end of thread, other threads:[~2021-08-27  8:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 13:41 [PATCH] crypto: add missing kernel_fpu_end() call Shreyansh Chouhan
2021-08-06  8:23 ` Herbert Xu
2021-08-06  9:05   ` Ard Biesheuvel
2021-08-06  9:07     ` Ard Biesheuvel
2021-08-06 10:36       ` Shreyansh Chouhan
2021-08-09 14:10         ` [PATCH] crypto: xts_crypt() return if walk.nbytes is 0 Shreyansh Chouhan
2021-08-17 14:18           ` Ard Biesheuvel
2021-08-20  8:31           ` Herbert Xu
2021-08-20 11:14             ` Ard Biesheuvel
2021-08-20 12:53               ` Herbert Xu
2021-08-22  3:45                 ` [PATCH v2] " Shreyansh Chouhan
2021-08-27  8:38                   ` Herbert Xu
2021-08-22  3:48                 ` [PATCH] " Shreyansh Chouhan
2021-08-22 13:23                 ` Ard Biesheuvel

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).