public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: clabbe.montjoie@gmail•com (Corentin LABBE)
To: linux-arm-kernel@lists•infradead.org
Subject: [linux-sunxi] Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator
Date: Sat, 16 May 2015 20:09:27 +0200	[thread overview]
Message-ID: <555787D7.80708@gmail.com> (raw)
In-Reply-To: <20150515065222.GA16808@gondor.apana.org.au>

Le 15/05/2015 08:52, Herbert Xu a ?crit :
> On Thu, May 14, 2015 at 02:59:01PM +0200, LABBE Corentin wrote:
>>
>> +int sun4i_hash_export(struct ahash_request *areq, void *out)
>> +{
>> +	struct sun4i_req_ctx *op = ahash_request_ctx(areq);
>> +
>> +	memcpy(out, op, sizeof(struct sun4i_req_ctx));
>> +	return 0;
>> +}
>> +
>> +int sun4i_hash_import(struct ahash_request *areq, const void *in)
>> +{
>> +	struct sun4i_req_ctx *op = ahash_request_ctx(areq);
>> +
>> +	memcpy(op, in, sizeof(struct sun4i_req_ctx));
> 
> This is very wrong.  You're importing an arbitrary ss pointer.  The
> whole point of having an import function instead of just a simple
> memcpy is to deal with such problems.
> 
> Cheers,
> 

Hello

You are right, I have totally mis-understood the export/import functions by just reading them from crypto/md5.c.
Reading them from drivers/crypto/* is better.

Incidental question, I need to use the MD5 IV for export_md5 function, but they are not defined anywhere (unlike SHAxx ones), does this is voluntary or do you will accept a patch for adding them.

Regards

  reply	other threads:[~2015-05-16 18:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 12:58 [PATCH v9] crypto: Add Allwinner Security System crypto accelerator LABBE Corentin
2015-05-14 12:58 ` [PATCH v9 1/4] ARM: sun7i: dt: Add Security System to A20 SoC DTS LABBE Corentin
2015-05-15  7:31   ` Maxime Ripard
2015-05-23 12:08     ` Corentin LABBE
2015-05-14 12:58 ` [PATCH v9 2/4] ARM: sun4i: dt: Add DT bindings documentation for SUN4I Security System LABBE Corentin
2015-05-14 12:59 ` [PATCH v9 3/4] MAINTAINERS: Add myself as maintainer of Allwinner " LABBE Corentin
2015-05-14 12:59 ` [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator LABBE Corentin
2015-05-15  6:49   ` Herbert Xu
2015-05-23 12:18     ` [linux-sunxi] " Corentin LABBE
2015-05-24  3:30       ` Herbert Xu
2015-05-15  6:52   ` Herbert Xu
2015-05-16 18:09     ` Corentin LABBE [this message]
2015-05-17  1:32       ` [linux-sunxi] " Herbert Xu
2015-05-17  8:45   ` Boris Brezillon
2015-05-17 10:34     ` Herbert Xu
2015-05-17 10:48       ` Boris Brezillon
2015-05-18  0:41         ` Herbert Xu
2015-05-18  7:24           ` Boris Brezillon
2015-05-18  8:33             ` Herbert Xu
2015-05-23 13:12     ` Corentin LABBE
2015-05-23 14:35       ` Boris Brezillon
2015-05-24  3:32         ` Herbert Xu
2015-05-24  8:04           ` [linux-sunxi] " Corentin LABBE
2015-05-24  8:12             ` Herbert Xu
2015-06-03 19:06         ` Corentin LABBE
2015-05-17  7:45 ` [PATCH v9] " Boris Brezillon

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=555787D7.80708@gmail.com \
    --to=clabbe.montjoie@gmail$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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