2020-06-28 20:00:51

by Eric Biggers

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY

On Sun, Jun 28, 2020 at 03:07:49PM -0400, Mikulas Patocka wrote:
> >
> > cryptd_create_skcipher(), cryptd_create_hash(), cryptd_create_aead(), and
> > crypto_rfc4309_create() are also missing setting the mask.
> >
> > pcrypt_create_aead() is missing both setting the mask and inheriting the flags.
>
> I added CRYPTO_ALG_ALLOCATES_MEMORY there.

I don't see where the cryptd request processing functions allocate memory.

It seems that cryptd should just inherit the flag, like most other templates.

Likewise for pcrypt.

And also likewise for rfc4309.

Where are you seeing the memory allocations that would require
CRYPTO_ALG_ALLOCATES_MEMORY to always be enabled for these?

- Eric


2020-06-29 19:18:58

by Mikulas Patocka

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY



On Sun, 28 Jun 2020, Eric Biggers wrote:

> On Sun, Jun 28, 2020 at 03:07:49PM -0400, Mikulas Patocka wrote:
> > >
> > > cryptd_create_skcipher(), cryptd_create_hash(), cryptd_create_aead(), and
> > > crypto_rfc4309_create() are also missing setting the mask.
> > >
> > > pcrypt_create_aead() is missing both setting the mask and inheriting the flags.
> >
> > I added CRYPTO_ALG_ALLOCATES_MEMORY there.
>
> I don't see where the cryptd request processing functions allocate memory.
>
> It seems that cryptd should just inherit the flag, like most other templates.
>
> Likewise for pcrypt.
>
> And also likewise for rfc4309.
>
> Where are you seeing the memory allocations that would require
> CRYPTO_ALG_ALLOCATES_MEMORY to always be enabled for these?
>
> - Eric

This was some misunderstanding. You said "cryptd_create_skcipher ... is
missing both setting the mask and inheriting the flags.", so I understood
it so that it should inherit CRYPTO_ALG_INHERITED_FLAGS and set
CRYPTO_ALG_ALLOCATES_MEMORY unconditionally.

Mikulas

2020-06-30 13:55:11

by Mikulas Patocka

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY



On Mon, 29 Jun 2020, Mikulas Patocka wrote:

> On Sun, 28 Jun 2020, Eric Biggers wrote:
>
> > On Sun, Jun 28, 2020 at 03:07:49PM -0400, Mikulas Patocka wrote:
> > > >
> > > > cryptd_create_skcipher(), cryptd_create_hash(), cryptd_create_aead(), and
> > > > crypto_rfc4309_create() are also missing setting the mask.
> > > >
> > > > pcrypt_create_aead() is missing both setting the mask and inheriting the flags.

pcrypt_create_aead doesn't use "mask" and "type" arguments at all.

Mikulas