Skip to content

Commit 7a87352

Browse files
author
CKI KWF Bot
committed
Merge: crypto: s390/paes - Fix memory leak on CTR final block
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1309 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> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: Vladis Dronov <vdronov@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 4b40f99 + 780b752 commit 7a87352

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)