From: Tom Lendacky <thomas.lendacky@amd.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: <linux-crypto@vger.kernel.org>, <stable@vger.kernel.org>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH v1] crypto: ccp - Limit the amount of information exported
Date: Mon, 1 Feb 2016 16:18:44 -0600 [thread overview]
Message-ID: <56AFD9C4.3030701@amd.com> (raw)
In-Reply-To: <20160201143506.GC11410@gondor.apana.org.au>
On 02/01/2016 08:35 AM, Herbert Xu wrote:
> On Fri, Jan 29, 2016 at 12:45:14PM -0600, Tom Lendacky wrote:
>> Since the exported information can be exposed to user-space, instead of
>> exporting the entire request context only export the minimum information
>> needed.
>>
>> Cc: <stable@vger.kernel.org> # 3.14.x-
>> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
>> ---
>> drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 16 +++++++++++-----
>> drivers/crypto/ccp/ccp-crypto-sha.c | 20 +++++++++++++++-----
>> drivers/crypto/ccp/ccp-crypto.h | 22 ++++++++++++++++++++++
>> 3 files changed, 48 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
>> index 00207cf..6a2d836 100644
>> --- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
>> +++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
>> @@ -223,9 +223,12 @@ static int ccp_aes_cmac_digest(struct ahash_request *req)
>> static int ccp_aes_cmac_export(struct ahash_request *req, void *out)
>> {
>> struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req);
>> - struct ccp_aes_cmac_req_ctx *state = out;
>> + struct ccp_aes_cmac_exp_ctx *state = out;
>>
>> - *state = *rctx;
>> + state->null_msg = rctx->null_msg;
>> + memcpy(state->iv, rctx->iv, sizeof(state->iv));
>> + state->buf_count = rctx->buf_count;
>> + memcpy(state->buf, rctx->buf, sizeof(state->buf));
>>
>> return 0;
>> }
>
> BTW this code needs to be fixed to not assume that in/out are
> aligned.
>
Ugh, yeah I missed that. I'll follow up with (yet) another patch
to be alignment safe.
Thanks,
Tom
> Cheers,
>
prev parent reply other threads:[~2016-02-01 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 18:45 [PATCH v1] crypto: ccp - Limit the amount of information exported Tom Lendacky
2016-02-01 14:34 ` Herbert Xu
2016-02-01 14:35 ` Herbert Xu
2016-02-01 22:18 ` Tom Lendacky [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=56AFD9C4.3030701@amd.com \
--to=thomas.lendacky@amd.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.