Skip to content

Commit 72ff2bf

Browse files
BK1603herbertx
authored andcommitted
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]>
1 parent cedcf52 commit 72ff2bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/crypto/aesni-intel_glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ static int xts_crypt(struct skcipher_request *req, bool encrypt)
849849
return -EINVAL;
850850

851851
err = skcipher_walk_virt(&walk, req, false);
852-
if (err)
852+
if (!walk.nbytes)
853853
return err;
854854

855855
if (unlikely(tail > 0 && walk.nbytes < walk.total)) {

0 commit comments

Comments
 (0)