Re: dm-integrity: don't store cipher request on the stack (was: [QUESTION] hash import and request initialization)

2018-01-10 Thread Mike Snitzer
On Wed, Jan 10 2018 at 9:32am -0500, Mikulas Patocka wrote: > > > On Wed, 27 Dec 2017, Herbert Xu wrote: > > > On Tue, Dec 26, 2017 at 02:21:53PM +0200, Gilad Ben-Yossef wrote: > > > > > > See how SKCIPHER_REQUEST_ON_STACK is being used with an asymmetric > > > skcipher > > > in drivers/md/

[PATCH] dm-integrity: don't store cipher request on the stack (was: [QUESTION] hash import and request initialization)

2018-01-10 Thread Mikulas Patocka
On Wed, 27 Dec 2017, Herbert Xu wrote: > On Tue, Dec 26, 2017 at 02:21:53PM +0200, Gilad Ben-Yossef wrote: > > > > See how SKCIPHER_REQUEST_ON_STACK is being used with an asymmetric skcipher > > in drivers/md/dm-integrity.c > > That's just broken. SKCIPHER_REQUEST_ON_STACK is only meant for >

Re: [QUESTION] hash import and request initialization

2017-12-26 Thread Gilad Ben-Yossef
On Wed, Dec 27, 2017 at 5:35 AM, Herbert Xu wrote: > On Tue, Dec 26, 2017 at 02:21:53PM +0200, Gilad Ben-Yossef wrote: >> >> See how SKCIPHER_REQUEST_ON_STACK is being used with an asymmetric skcipher >> in drivers/md/dm-integrity.c > > That's just broken. SKCIPHER_REQUEST_ON_STACK is only meant

Re: [QUESTION] hash import and request initialization

2017-12-26 Thread Herbert Xu
On Tue, Dec 26, 2017 at 02:21:53PM +0200, Gilad Ben-Yossef wrote: > > See how SKCIPHER_REQUEST_ON_STACK is being used with an asymmetric skcipher > in drivers/md/dm-integrity.c That's just broken. SKCIPHER_REQUEST_ON_STACK is only meant for sync algorithms and this code needs to be changed to ei

Re: [QUESTION] hash import and request initialization

2017-12-26 Thread Gilad Ben-Yossef
On Tue, Dec 26, 2017 at 12:40 PM, Herbert Xu wrote: > On Tue, Dec 26, 2017 at 11:06:02AM +0200, Gilad Ben-Yossef wrote: >> >> The hash state needs to be DMAed in and out of the hardware on each operation >> and I have no guarantee that the ahash request is allocated from DMAable >> memory >> (i.e

Re: [QUESTION] hash import and request initialization

2017-12-26 Thread Herbert Xu
On Tue, Dec 26, 2017 at 11:06:02AM +0200, Gilad Ben-Yossef wrote: > > The hash state needs to be DMAed in and out of the hardware on each operation > and I have no guarantee that the ahash request is allocated from DMAable > memory > (i.e. AHASH_REQUEST_ON_STACK). AHASH_REQUEST_ON_STACK cannot po

Re: [QUESTION] hash import and request initialization

2017-12-26 Thread Gilad Ben-Yossef
On Tue, Dec 26, 2017 at 5:07 AM, Herbert Xu wrote: > On Mon, Dec 25, 2017 at 10:07:54AM +0200, Gilad Ben-Yossef wrote: >> Hi there, >> >> I have ran into something I am unsure about regarding the ccree driver >> implementation and would love to get some guidance: >> >> I have assumed, based on pre

Re: [QUESTION] hash import and request initialization

2017-12-25 Thread Herbert Xu
On Mon, Dec 25, 2017 at 10:07:54AM +0200, Gilad Ben-Yossef wrote: > Hi there, > > I have ran into something I am unsure about regarding the ccree driver > implementation and would love to get some guidance: > > I have assumed, based on previous list correspondence, that both of > the following se

[QUESTION] hash import and request initialization

2017-12-25 Thread Gilad Ben-Yossef
Hi there, I have ran into something I am unsure about regarding the ccree driver implementation and would love to get some guidance: I have assumed, based on previous list correspondence, that both of the following sequences are legal: Scenario A 1. ahash_request_alloc 2. ahash_import Scenario