Re: [RFC PATCH crypto 4/4] AES-NI: Add support to Intel AES-NIinstructions for x86_64 platform

From: Huang Ying
Date: Mon Jan 12 2009 - 21:49:22 EST


On Tue, 2009-01-13 at 10:39 +0800, Herbert Xu wrote:
> On Tue, Jan 13, 2009 at 10:34:13AM +0800, Huang Ying wrote:
> >
> > static void ablk_complete(struct crypto_async_request *req, int err)
> > {
> > struct ablkcipher_request *ablk_req = ablkcipher_request_cast(req);
> > struct async_aes_req_ctx *req_ctx =
> > ablk_aes_req_ctx(ablk_req, crypto_ablkcipher_reqtfm(ablk_req));
>
> This is not guaranteed to work. Your completion caller may be
> called with a request pointer other than the one that you passed
> to it. The only thing we guarantee is that req->data has the
> value that you set at the beginning.

I can set req->data in xx_encrypt() to my original request to solve this
issue. Except that, does this solution work?

Best Regards,
Huang Ying

Attachment: signature.asc
Description: This is a digitally signed message part