Re: [PATCH 0/5] Remove CRYPTO_ALG_ALLOCATES_MEMORY flag

From: Giovanni Cabiddu
Date: Thu Jun 01 2023 - 07:24:26 EST


On Thu, Jun 01, 2023 at 11:33:48AM +0100, Herbert Xu wrote:
> On Tue, May 23, 2023 at 04:55:03PM +0000, Eric Biggers wrote:
> >
> > This isn't mentioned in the documentation for CRYPTO_ALG_ALLOCATES_MEMORY. So
> > it's not part of the contract of CRYPTO_ALG_ALLOCATES_MEMORY currently.
> >
> > Please don't make this change without updating the documentation.
> >
> > If you'd like to make this change, please update the documentation for
> > CRYPTO_ALG_ALLOCATES_MEMORY to mention this additional exception.
>
> Agreed. We talked about this at the time of the original patch-set,
> but never made any changes in this direction.
>
> Apparently the users are still the same so it should be possible
> but it has to be done in the right order as Eric suggested.
BTW, some time ago we did an assessment of the users of
!CRYPTO_ALG_ALLOCATES_MEMORY and we came to the conclusion that we
cannot just update the documentation.
dm-crypt uses scatterlists with at most 4 entries. dm-integrity,
instead, might allocate memory for scatterlists with an arbitrary number
of entries.

https://www.spinics.net/lists/linux-crypto/msg65282.html

Any suggestion on how to move forward for drivers that allocate memory?

Regards,

--
Giovanni