diff options
author | Shreyansh Chouhan <chouhan.shreyansh630@gmail.com> | 2021-08-22 06:45:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-10-07 08:53:19 +0300 |
commit | 38c84dfafed5b1193d083e0121ccd985ce5f5bdc (patch) | |
tree | 7cf7d4e74fcfe14e5c78491a9f20f0b715ecb7aa /arch | |
parent | 2b704864c92dcec2b295f276fcfbfb81d9831f81 (diff) | |
download | linux-38c84dfafed5b1193d083e0121ccd985ce5f5bdc.tar.xz |
crypto: aesni - xts_crypt() return if walk.nbytes is 0
commit 72ff2bf04db2a48840df93a461b7115900f46c05 upstream.
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: syzbot+20191dc583eff8602d2d@syzkaller.appspotmail.com
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-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)) { |