Re: [PATCH v2 20/20] s390/pkey/crypto: Introduce xflags param for pkey in-kernel API

Holger Dengler
2025-03-20T16:34:54Z

On 04/03/2025 18:21, Harald Freudenberger wrote:
> Add a new parameter xflags to the in-kernel API function
> pkey_key2protkey(). Currently there is only one flag supported:
>
> * PKEY_XFLAG_NOMEMALLOC:
> If this flag is given in the xflags parameter, the pkey implementation
> is not allowed to allocate memory but instead should fall back to use
> preallocated memory or simple fail with -ENOMEM.
> This flag is for protected key derive within a cipher or similar
> which must not allocate memory which would cause io operations - see
> also the CRYPTO_ALG_ALLOCATES_MEMORY flag in crypto.h.
>
> The one and only user of this in-kernel API - the skcipher
> implementations PAES in paes_s390.c set this flag upon request
> to derive a protected key from the given raw key material.
>
> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>

Reviewed-by: Holger Dengler <dengler@linux.ibm.com>

--
Mit freundlichen Grüßen / Kind regards
Holger Dengler
--
IBM Systems, Linux on IBM Z Development
dengler@linux.ibm.com