]> Gentwo Git Trees - linux/.git/commit
s390/zcrypt: Avoid alloc and copy of ep11 targets if kernelspace cprb
authorHarald Freudenberger <freude@linux.ibm.com>
Thu, 24 Apr 2025 13:35:58 +0000 (15:35 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 30 Apr 2025 09:34:00 +0000 (11:34 +0200)
commitf91bb85d399ecfa69ec08ebf58ee49d17bb748e2
treeddde1dd319e9acb1065c9665c93f811f13732446
parentdcc160b3a090b1ffa0710ed72ae325be37298c0e
s390/zcrypt: Avoid alloc and copy of ep11 targets if kernelspace cprb

If there is a target list of APQNs given when an CPRB is
to be send via zcrypt_send_ep11_cprb() there is always a
kmalloc() done and the targets are copied via z_copy_from_user.

As there are callers from kernel space (zcrypt_ep11misc.c)
which signal this via the userspace parameter improve this
code to directly use the given target list in case of
kernelspace thus removing the unnecessary memory alloc
and mem copy.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Link: https://lore.kernel.org/r/20250424133619.16495-5-freude@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/crypto/zcrypt_api.c