2007-10-25 20:08:34

by Vlad Yasevich

[permalink] [raw]
Subject: [PATCH] [CRYPTO]: Fix hmac_digest from the SG breakage.

Crypto now uses SG helper functions. Fix hmac_digest to use those
functions correctly and fix the oops associated with it.

Signed-off-by: Vlad Yasevich <[email protected]>
---
crypto/hmac.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/crypto/hmac.c b/crypto/hmac.c
index e4eb6ac..8b7a832 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -158,10 +158,12 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg,
desc.tfm = ctx->child;
desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;

+ sg_init_table(sg1, 2);
sg_set_buf(sg1, ipad, bs);
-
- sg_set_page(&sg[1], (void *) sg);
+ sg_set_page(&sg1[1], (void *) sg);
sg1[1].length = 0;
+
+ sg_init_table(sg2, 1);
sg_set_buf(sg2, opad, bs + ds);

err = crypto_hash_digest(&desc, sg1, nbytes + bs, digest);
--
1.5.2.4


2007-10-26 01:47:05

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] [CRYPTO]: Fix hmac_digest from the SG breakage.

From: Vlad Yasevich <[email protected]>
Date: Thu, 25 Oct 2007 16:07:17 -0400

> Crypto now uses SG helper functions. Fix hmac_digest to use those
> functions correctly and fix the oops associated with it.
>
> Signed-off-by: Vlad Yasevich <[email protected]>

Since I keep hitting this when I try to test IPSEC on my systems
I'm going to apply this to my net-2.6 tree.

Herbert, I hope you don't mind :-)

2007-10-26 02:42:45

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] [CRYPTO]: Fix hmac_digest from the SG breakage.

On Thu, Oct 25, 2007 at 06:46:54PM -0700, David Miller wrote:
>
> Since I keep hitting this when I try to test IPSEC on my systems
> I'm going to apply this to my net-2.6 tree.
>
> Herbert, I hope you don't mind :-)

It looks good to me. Thanks Dave!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2007-10-26 13:44:15

by Vlad Yasevich

[permalink] [raw]
Subject: Re: [PATCH] [CRYPTO]: Fix hmac_digest from the SG breakage.

David Miller wrote:
> From: Vlad Yasevich <[email protected]>
> Date: Thu, 25 Oct 2007 16:07:17 -0400
>
>> Crypto now uses SG helper functions. Fix hmac_digest to use those
>> functions correctly and fix the oops associated with it.
>>
>> Signed-off-by: Vlad Yasevich <[email protected]>
>
> Since I keep hitting this when I try to test IPSEC on my systems
> I'm going to apply this to my net-2.6 tree.
>
> Herbert, I hope you don't mind :-)
>

Got reported to me because SCTP kept breaking. Wasn't sure which
way to send it.

As long as it's somewhere, I am happy.

Thanks
-vlad

2007-10-26 14:08:19

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] [CRYPTO]: Fix hmac_digest from the SG breakage.

On Fri, Oct 26, 2007 at 09:43:31AM -0400, Vlad Yasevich wrote:
>
> Got reported to me because SCTP kept breaking. Wasn't sure which
> way to send it.
>
> As long as it's somewhere, I am happy.

I'm happy too :)

Dave has kindly fixed the IPsec stack to initalise the tables
properly. I'm currently in the process of fixing the rest of
the crypto users to initalise the tables properly.

Jens, could you please do a similar run for the rest of the
kernel?

Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2007-10-26 17:00:28

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] [CRYPTO]: Fix hmac_digest from the SG breakage.

On Fri, Oct 26 2007, Herbert Xu wrote:
> On Fri, Oct 26, 2007 at 09:43:31AM -0400, Vlad Yasevich wrote:
> >
> > Got reported to me because SCTP kept breaking. Wasn't sure which
> > way to send it.
> >
> > As long as it's somewhere, I am happy.
>
> I'm happy too :)
>
> Dave has kindly fixed the IPsec stack to initalise the tables
> properly. I'm currently in the process of fixing the rest of
> the crypto users to initalise the tables properly.
>
> Jens, could you please do a similar run for the rest of the
> kernel?

Yeah, I've already done large parts of it, will continue to make sure
everything gets seen.

--
Jens Axboe