From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3 V4] crypto: Fix the pointer voodoo in unaligned ahash
Date: Fri, 21 Mar 2014 19:31:02 +0100 [thread overview]
Message-ID: <201403211931.02812.marex@denx.de> (raw)
In-Reply-To: <20140321144007.GA25820@gondor.apana.org.au>
On Friday, March 21, 2014 at 03:40:07 PM, Herbert Xu wrote:
> On Fri, Mar 14, 2014 at 02:37:04AM +0100, Marek Vasut wrote:
> > Add documentation for the pointer voodoo that is happening in
> > crypto/ahash.c in ahash_op_unaligned(). This code is quite confusing, so
> > add a beefy chunk of documentation.
> >
> > Moreover, make sure the mangled request is completely restored after
> > finishing this unaligned operation. This means restoring all of .result,
> > .base.data and .base.complete .
> >
> > Also, remove the crypto_completion_t complete = ... line present in the
> > ahash_op_unaligned_done() function. This type actually declares a
> > function pointer, which is very confusing.
> >
> > Finally, yet very important nonetheless, make sure the req->priv is
> > free()'d only after the original request is restored in
> > ahash_op_unaligned_done(). The req->priv data must not be free()'d
> > before that in ahash_op_unaligned_finish(), since we would be accessing
> > previously free()'d data in ahash_op_unaligned_done() and cause
> > corruption.
> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: David S. Miller <davem@davemloft.net>
> > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > Cc: Herbert Xu <herbert@gondor.apana.org.au>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Tom Lendacky <thomas.lendacky@amd.com>
>
> All applied. Thanks Marek!
Thank you for kicking me in the right direction all the time and thanks for your
patience with me !
Best regards,
Marek Vasut
prev parent reply other threads:[~2014-03-21 18:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 1:37 [PATCH 1/3 V4] crypto: Fix the pointer voodoo in unaligned ahash Marek Vasut
2014-03-14 1:37 ` [PATCH 2/3 V4] crypto: Pull out the functions to save/restore request Marek Vasut
2014-03-14 1:37 ` [PATCH 3/3 V4] crypto: Simplify the ahash_finup implementation Marek Vasut
2014-03-21 14:40 ` [PATCH 1/3 V4] crypto: Fix the pointer voodoo in unaligned ahash Herbert Xu
2014-03-21 18:31 ` Marek Vasut [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=201403211931.02812.marex@denx.de \
--to=marex@denx.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).