Re: Bug of dm-crypt?

2009-02-27 Thread Milan Broz
Herbert Xu wrote: On Fri, Feb 27, 2009 at 01:31:56PM +0800, Huang Ying wrote: I had ever heard from you that the only thing guaranteed in the completion function of async ablkcipher cryption is the req-data has the value you set before. The request pointer itself may be changed. But in

[BUGFIX] dm-crypt: Fix a bug of async cryption complete function

2009-02-27 Thread Huang Ying
In async cryption complete function (kcryptd_async_done), the crypto_async_request passed in may be different from the one passed to crypto_ablkcipher_encrypt/decrypt. Only crypto_async_request-data is guaranteed to be same as the passed in one. Current kcryptd_async_done uses passed in

Re: Bug of dm-crypt?

2009-02-27 Thread Huang Ying
Hi, Milan, On Fri, 2009-02-27 at 16:41 +0800, Milan Broz wrote: Herbert Xu wrote: On Fri, Feb 27, 2009 at 01:31:56PM +0800, Huang Ying wrote: I had ever heard from you that the only thing guaranteed in the completion function of async ablkcipher cryption is the req-data has the value you

Re: [PATCH] ixp4xx_crypto panic with fragmented packets in scatterlist

2009-02-27 Thread Christian Hohnstaedt
On Thu, Feb 26, 2009 at 09:27:09PM +0100, Karl Hiramoto wrote: Herbert Xu wrote: Russell King - ARM Linux li...@arm.linux.org.uk wrote: We can't merge this until _all_ of ARM has been fixed for walking scatterlist chains. Right, this is definitely not the way to fix this bug.

Re: Bug of dm-crypt?

2009-02-27 Thread Herbert Xu
On Fri, Feb 27, 2009 at 09:41:02AM +0100, Milan Broz wrote: Can you send me backtrace from that panic? What's wrong in async callback now - mempool_free using async_req directly? The req you get in the completion function is not necessarily the req that you started with. The only thing you

Re: [BUGFIX] dm-crypt: Fix a bug of async cryption complete function

2009-02-27 Thread Herbert Xu
On Fri, Feb 27, 2009 at 04:56:11PM +0800, Huang Ying wrote: @@ -830,7 +838,7 @@ static void kcryptd_async_done(struct cr return; } - mempool_free(ablkcipher_request_cast(async_req), cc-req_pool); + mempool_free(dmreq-req, cc-req_pool); Why do we need all this

Re: [BUGFIX] dm-crypt: Fix a bug of async cryption complete function

2009-02-27 Thread Milan Broz
Herbert Xu wrote: On Fri, Feb 27, 2009 at 04:56:11PM +0800, Huang Ying wrote: @@ -830,7 +838,7 @@ static void kcryptd_async_done(struct cr return; } -mempool_free(ablkcipher_request_cast(async_req), cc-req_pool); +mempool_free(dmreq-req, cc-req_pool); Why do

Re: [BUGFIX] dm-crypt: Fix a bug of async cryption complete function

2009-02-27 Thread Milan Broz
Herbert Xu wrote: On Fri, Feb 27, 2009 at 12:52:05PM +0100, Milan Broz wrote: Herbert Xu wrote: On Fri, Feb 27, 2009 at 04:56:11PM +0800, Huang Ying wrote: @@ -830,7 +838,7 @@ static void kcryptd_async_done(struct cr return; } -

Re: [BUGFIX] dm-crypt: Fix a bug of async cryption complete function

2009-02-27 Thread Herbert Xu
On Fri, Feb 27, 2009 at 01:28:46PM +0100, Milan Broz wrote: Like this? struct ablkcipher_request *req = (char *)dmreq - cc-dmreq_start; mempool_free(req, cc-req_pool); Exactly. You could also embed the ablkcipher_request at the end of dmreq, as in struct dm_crypt_request { struct

Re: [BUGFIX] dm-crypt: Fix a bug of async cryption complete function

2009-02-27 Thread Milan Broz
Herbert Xu wrote: On Fri, Feb 27, 2009 at 01:28:46PM +0100, Milan Broz wrote: Like this? struct ablkcipher_request *req = (char *)dmreq - cc-dmreq_start; mempool_free(req, cc-req_pool); Exactly. You could also embed the ablkcipher_request at the end of dmreq, as in struct