[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0402MB3342B99A1BEA5622F29F79EF98CF0@VI1PR0402MB3342.eurprd04.prod.outlook.com>
Date: Tue, 20 Feb 2018 11:32:25 +0000
From: Horia Geantă <horia.geanta@....com>
To: Herbert Xu <herbert@...dor.apana.org.au>
CC: Christophe LEROY <christophe.leroy@....fr>,
"David S. Miller" <davem@...emloft.net>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside
the requests
On 2/20/2018 12:34 PM, Herbert Xu wrote:
> On Mon, Feb 19, 2018 at 01:16:30PM +0000, Horia Geantă wrote:
>>
>>> And what about ALGIF path from user space ?
>>> What if the user never calls the last sendmsg() which will call
>>> hash_finup() ?
>>>
>> User is expected to follow the rules of the crypto API.
>> Of course, kernel won't (or at least shouldn't) crash in case of misuse.
>> However, in these cases some resources might not be freed - it's unavoidable.
>
> the crypto API does not require the presence of a finalisation.
> It is entirely optional. So leaving resources pinned down until
> final/finup occurs is unacceptable, both from user-space and the
> kernel.
>
If final/finup is optional, how is the final hash supposed to be retrieved?
According to documentation, these are the accepted flows (with the option to
export/import a partial hash b/w update and final/finup):
.init() -> .update() -> .final()
^ | |
'----' '---> HASH
.init() -> .update() -> .finup()
^ | |
'----' '---> HASH
.digest()
|
'---------------> HASH
Note that digest() is not an issue in the case we are discussing, since resource
allocation happens only in init().
Thanks,
Horia
Powered by blists - more mailing lists