diff options
author | Shreyansh Chouhan <[email protected]> | 2021-08-22 09:15:14 +0530 |
---|---|---|
committer | Herbert Xu <[email protected]> | 2021-08-27 16:30:19 +0800 |
commit | 72ff2bf04db2a48840df93a461b7115900f46c05 (patch) | |
tree | 1c531524d701de54ed6e289a338ba8a784be2406 | |
parent | cedcf527d59bcca5f87f52ea34a157bbc6e7a3a8 (diff) |
crypto: aesni - xts_crypt() return if walk.nbytes is 0
xts_crypt() code doesn't call kernel_fpu_end() after calling
kernel_fpu_begin() if walk.nbytes is 0. The correct behavior should be
not calling kernel_fpu_begin() if walk.nbytes is 0.
Reported-by: [email protected]
Signed-off-by: Shreyansh Chouhan <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
-rw-r--r-- | arch/x86/crypto/aesni-intel_glue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index 388643ca2177..0fc961bef299 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c @@ -849,7 +849,7 @@ static int xts_crypt(struct skcipher_request *req, bool encrypt) return -EINVAL; err = skcipher_walk_virt(&walk, req, false); - if (err) + if (!walk.nbytes) return err; if (unlikely(tail > 0 && walk.nbytes < walk.total)) { |