From: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
To: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Romain Francoise <romain@orebokech.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: Linux 3.6-rc5
Date: Sun, 09 Sep 2012 23:54:04 +0300 [thread overview]
Message-ID: <20120909235404.747466tf3h2pbf48@www.81.fi> (raw)
In-Reply-To: <20120909185358.GA9782@gondor.apana.org.au>
Quoting Herbert Xu <herbert@gondor.apana.org.au>:
> On Sun, Sep 09, 2012 at 08:35:56AM -0700, Linus Torvalds wrote:
>> On Sun, Sep 9, 2012 at 5:54 AM, Jussi Kivilinna
>> <jussi.kivilinna@mbnet.fi> wrote:
>> >
>> > Does reverting e46e9a46386bca8e80a6467b5c643dc494861896 help?
>> >
>> > That commit added crypto selftest for authenc(hmac(sha1),cbc(aes)) in 3.6,
>> > and probably made this bug visible (but not directly causing it).
>>
>> So Romain said it does - where do we go from here? Revert testing it,
>> or fix the authenc() case? I'd prefer the fix..
>
> I'm working on this right now. If we don't get anywhere in a
> couple of days we can revert the test vector patch.
>
It seems that authenc is chaining empty assoc scatterlist, which causes
BUG_ON(!sg->length) set off in crypto/scatterwalk.c.
Following fixes the bug and self-test passes, but not sure if it's correct
(note, copy-paste to 'broken' email client, most likely does not apply etc):
diff --git a/crypto/authenc.c b/crypto/authenc.c
index 5ef7ba6..2373af5 100644
--- a/crypto/authenc.c
+++ b/crypto/authenc.c
@@ -336,7 +336,7 @@ static int crypto_authenc_genicv(struct
aead_request *req, u8 *iv,
cryptlen += ivsize;
}
- if (sg_is_last(assoc)) {
+ if (req->assoclen > 0 && sg_is_last(assoc)) {
authenc_ahash_fn = crypto_authenc_ahash;
sg_init_table(asg, 2);
sg_set_page(asg, sg_page(assoc), assoc->length,
assoc->offset);
Also does crypto_authenc_iverify() need same fix?
-Jussi
> Cheers,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
>
next prev parent reply other threads:[~2012-09-09 20:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-09 0:18 Linux 3.6-rc5 Linus Torvalds
2012-09-09 9:13 ` Romain Francoise
2012-09-09 12:54 ` Jussi Kivilinna
2012-09-09 14:23 ` Romain Francoise
2012-09-09 15:35 ` Linus Torvalds
2012-09-09 18:53 ` Herbert Xu
2012-09-09 20:54 ` Jussi Kivilinna [this message]
2012-09-09 21:01 ` Herbert Xu
2012-09-09 19:19 ` Herbert Xu
2012-09-09 20:09 ` Mathias Krause
2012-09-09 21:00 ` Herbert Xu
2012-09-09 21:09 ` Mathias Krause
2012-09-10 17:18 ` Romain Francoise
2012-09-09 20:26 ` Jussi Kivilinna
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=20120909235404.747466tf3h2pbf48@www.81.fi \
--to=jussi.kivilinna@mbnet.fi \
--cc=herbert@gondor.hengli.com.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=romain@orebokech.com \
--cc=torvalds@linux-foundation.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).