Skip to content

Commit 780b752

Browse files
author
Herbert Xu
committed
crypto: s390/paes - Fix memory leak on CTR final block
JIRA: https://issues.redhat.com/browse/RHEL-106158 Upstream Status: RHEL only The skcipher_walk_done call on the final CTR block is made with the argument nbytes instead of 0. That tells the Crypto API that paes is not yet done with the processing. This causes any temporary memory to be leaked. Fix this by using 0 instead of nbytes. This was fixed upstream by commit 6cd87cb ("s390/crypto: Rework protected key AES for true asynch support"). Signed-off-by: Herbert Xu <herbert.xu@redhat.com>
1 parent 6a78f7d commit 780b752

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/crypto/paes_s390.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ static int ctr_paes_crypt(struct skcipher_request *req)
874874
}
875875
memcpy(walk.dst.virt.addr, buf, nbytes);
876876
crypto_inc(walk.iv, AES_BLOCK_SIZE);
877-
rc = skcipher_walk_done(&walk, nbytes);
877+
rc = skcipher_walk_done(&walk, 0);
878878
}
879879

880880
return rc;

0 commit comments

Comments
 (0)