]> Git Repo - linux.git/commitdiff
crypto: aesni - xts_crypt() return if walk.nbytes is 0
authorShreyansh Chouhan <[email protected]>
Sun, 22 Aug 2021 03:45:14 +0000 (09:15 +0530)
committerHerbert Xu <[email protected]>
Fri, 27 Aug 2021 08:30:19 +0000 (16:30 +0800)
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]>
arch/x86/crypto/aesni-intel_glue.c

index 388643ca2177e63a78030e84048d374da1cd66bd..0fc961bef299c993458b889db717caf00aeaaa3f 100644 (file)
@@ -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)) {
This page took 0.055266 seconds and 4 git commands to generate.