From: Herbert Xu <herbert@gondor.apana.org.au>
To: Huang Ying <ying.huang@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Subject: Re: [BUGFIX -v3 for .32] crypto, gcm, fix another complete call in complete fuction
Date: Mon, 16 Nov 2009 21:52:59 +0800 [thread overview]
Message-ID: <20091116135258.GA4798@gondor.apana.org.au> (raw)
In-Reply-To: <1257838751.22519.2513.camel@yhuang-dev.sh.intel.com>
On Tue, Nov 10, 2009 at 03:39:11PM +0800, Huang Ying wrote:
> The flow of the complete function (xxx_done) in gcm.c is as follow:
>
> void complete(struct crypto_async_request *areq, int err)
> {
> struct aead_request *req = areq->data;
>
> if (!err) {
> err = async_next_step();
> if (err == -EINPROGRESS || err == -EBUSY)
> return;
> }
>
> complete_for_next_step(areq, err);
> }
>
> But *areq may be destroyed in async_next_step(), this makes
> complete_for_next_step() can not work properly. To fix this, one of
> following methods is used for each complete function.
>
> - Add a __complete() for each complete(), which accept struct
> aead_request *req instead of areq, so avoid using areq after it is
> destroyed.
>
> - Expand complete_for_next_step().
>
> The fixing method is based on the idea of Herbert Xu.
>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
Applied to crypto-2.6. Thanks a lot!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2009-11-16 13:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 7:39 Huang Ying
2009-11-16 13:52 ` Herbert Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091116135258.GA4798@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®