Re: [PATCH] crypto: testmgr - don't DMA map IV from stack in test_skcipher()

2017-03-08 Thread Herbert Xu
On Wed, Mar 08, 2017 at 01:04:14PM +, Horia Geantă wrote:
>
> Since changing the API and converting the users looks pretty lengthy,
> would it be acceptable to fix tcrypt for now?
> Indeed, I've missed updating test_skcipher_speed, I can add this in v2.

Might as well leave it there because at least it reminds us to
fix the problem.  With the API as it is any new kernel user could
potentially provide us with an IV off the stack.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: testmgr - don't DMA map IV from stack in test_skcipher()

2017-03-08 Thread Horia Geantă
On 1/13/2017 10:46 AM, Herbert Xu wrote:
> On Fri, Jan 13, 2017 at 08:59:16AM +0200, Horia Geantă wrote:
>> Fix the "DMA-API: device driver maps memory from stack" warning
>> generated when crypto accelerators map the IV.
>>
>> Signed-off-by: Horia Geantă 
> 
> Hmm, the IV comes in as a pointer.  So you should not assume that
> it can be DMAed at all.
> 
That's correct, thanks for pointing it out.

> Perhaps we should change the API so that it gets passed in as an
> SG list.
> 
Since changing the API and converting the users looks pretty lengthy,
would it be acceptable to fix tcrypt for now?
Indeed, I've missed updating test_skcipher_speed, I can add this in v2.

Thanks,
Horia



Re: [PATCH] crypto: testmgr - don't DMA map IV from stack in test_skcipher()

2017-01-13 Thread Herbert Xu
On Fri, Jan 13, 2017 at 08:59:16AM +0200, Horia Geantă wrote:
> Fix the "DMA-API: device driver maps memory from stack" warning
> generated when crypto accelerators map the IV.
> 
> Signed-off-by: Horia Geantă 

Hmm, the IV comes in as a pointer.  So you should not assume that
it can be DMAed at all.

Perhaps we should change the API so that it gets passed in as an
SG list.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html