From: "Stephan Müller" <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: algif_aead - Require setkey before accept(2)
Date: Mon, 24 Apr 2017 11:01:50 +0200 [thread overview]
Message-ID: <3234815.BdC1qsBGSt@tauon.chronox.de> (raw)
In-Reply-To: <20170424084324.GA20473@gondor.apana.org.au>
Am Montag, 24. April 2017, 10:43:24 CEST schrieb Herbert Xu:
Hi Herbert,
> On Fri, Apr 21, 2017 at 06:35:07PM +0200, Stephan Müller wrote:
> > After checking again, IMHO that is no unreleated cleanup or even a cleanup
> > at all.
> >
> > void *private used to be struct crypto_aead and is now struct aead_tfm.
> > struct crypto_aead is found in private->aead. Hence, the patch assigned
> > private to tfm and then obtained the struct crypto_aead pointer. As this
> > was not necessary before, it is a required extension IMHO.
>
> Fair enough.
>
> But what about the change in aead_sock_destruct? Can you explain why
> it is no longer possible to obtain the tfm from ctx->aead_req?
>
> Thanks,
aead_request_set_callback(&ctx->aead_req) is set in aead_accept_parent_nokey.
aead_accept_parent_nokey is only invoked from aead_accept_parent if the key
was set.
My thought was: Let us assume a caller does not set a key, calls accept and
then destruct. In this code path, ctx->aead_req is not initialized. Hence, I
would think that only the path using struct aead_tfm is safe in any case.
But I see that aead_sock_destruct is also linked in by
aead_accept_parent_nokey. Hence, my initial idea was not correct as the
destruct path is only callable when the accept_nokey is invoked.
Shall I send an updated patch with aead_sock_destruct cleared?
Ciao
Stephan
next prev parent reply other threads:[~2017-04-24 9:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-10 11:59 [PATCH] crypto: algif_aead - Require setkey before accept(2) Stephan Müller
2017-04-21 11:11 ` Herbert Xu
2017-04-21 15:33 ` Stephan Müller
2017-04-21 16:35 ` Stephan Müller
2017-04-24 8:43 ` Herbert Xu
2017-04-24 9:01 ` Stephan Müller [this message]
2017-04-24 9:03 ` Herbert Xu
2017-04-24 9:15 ` [PATCH v2] " Stephan Müller
2017-04-24 10:22 ` Herbert Xu
2017-04-24 10:26 ` Stephan Müller
2017-04-25 8:47 ` Herbert Xu
2017-04-25 8:54 ` Stephan Müller
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=3234815.BdC1qsBGSt@tauon.chronox.de \
--to=smueller@chronox.de \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.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).