]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/zcrypt: Fix memory leak with CCA cards used as accelerator
authorHarald Freudenberger <freude@linux.ibm.com>
Thu, 19 Mar 2026 08:06:52 +0000 (09:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Apr 2026 12:29:52 +0000 (14:29 +0200)
commitace37bfec3822033e59fff390f2ff99fc96ebe4f
tree5123258fb60e815eaad08d5ecb4936e5a379f294
parentb7c0fc21ec01a563950f7fead63a820533d47f23
s390/zcrypt: Fix memory leak with CCA cards used as accelerator

commit c8d46f17c2fc7d25c18e60c008928aecab26184d upstream.

Tests showed that there is a memory leak if CCA cards are used as
accelerator for clear key RSA requests (ME and CRT). With the last
rework for the memory allocation the AP messages are allocated by
ap_init_apmsg() but for some reason on two places (ME and CRT) the
older allocation was still in place. So the first allocation simple
was never freed.

Fixes: 57db62a130ce ("s390/ap/zcrypt: Rework AP message buffer allocation")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Closes: https://lore.kernel.org/linux-s390/CAHj4cs9H67Uz0iVaRQv447p7JFPRPy3TKAT4=Y6_e=wSHCZM5w@mail.gmail.com/
Reported-by: Nadja Hariz <Nadia.Hariz@ibm.com>
Cc: stable@vger.kernel.org
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/s390/crypto/zcrypt_msgtype6.c