From: Junio C Hamano <gitster@pobox.com>
To: "Martin Ågren" <martin.agren@gmail.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Andreas Schwab" <schwab@suse.de>,
"Lars Schneider" <larsxschneider@gmail.com>,
"Git Mailing List" <git@vger.kernel.org>,
"Marc Stevens" <marc@marc-stevens.nl>
Subject: Re: Unaligned accesses in sha1dc
Date: Fri, 02 Jun 2017 09:15:17 +0900 [thread overview]
Message-ID: <xmqq37bj454a.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAN0heSp9DpW4_0QL57_oAHGu+os8k6yd=Z5+0MJnaL6iXTa-qQ@mail.gmail.com> ("Martin Ågren"'s message of "Thu, 1 Jun 2017 17:57:48 +0200")
Martin Ågren <martin.agren@gmail.com> writes:
> I looked into this some more. It turns out it is possible to trigger
> undefined behavior on "next". Here's what I did:
> ...
>
> This "fixes" the problem:
> ...
> diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c
> index 3dff80a..d6f4c44 100644
> --- a/sha1dc/sha1.c
> +++ b/sha1dc/sha1.c
> @@ -66,9 +66,9 @@
> ...
> With this diff, various tests which seem relevant for SHA-1 pass,
> including t0013, and the UBSan-error is gone. The second diff is just
> a monkey-patch. I have no reason to believe I will be able to come up
> with a proper and complete patch for sha1dc. And I guess such a thing
> would not really be Git's patch to carry, either. But at least Git
> could consider whether to keep relying on undefined behavior or not.
>
> There's a fair chance I've mangled the whitespace. I'm using gmail's
> web interface... Sorry about that.
Thanks. I see Marc Stevens is CC'ed in the thread, so I'd expect
that the final "fix" would come from his sha1collisiondetection
repository via Ævar.
In the meantime, I am wondering if it makes sense to merge the
earlier update with #ifdef ALLOW_UNALIGNED_ACCESS and #ifdef
SHA1DC_FORCE_LITTLEENDIAN for the v2.13.x maintenance track, which
would at least unblock those on platforms v2.13.0 did not work
correctly at all.
Ævar, thoughts?
next prev parent reply other threads:[~2017-06-02 0:15 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 8:28 Unaligned accesses in sha1dc Andreas Schwab
[not found] ` <CDB32E2C-48AF-4636-B921-4C45B614FD35@marc-stevens.nl>
2017-06-01 9:05 ` Andreas Schwab
2017-06-01 9:15 ` Junio C Hamano
2017-06-01 9:15 ` Andreas Schwab
2017-06-01 9:34 ` Junio C Hamano
2017-06-01 9:18 ` brian m. carlson
2017-06-01 9:32 ` Andreas Schwab
2017-06-01 9:21 ` Lars Schneider
2017-06-01 9:53 ` Junio C Hamano
2017-06-01 10:08 ` Andreas Schwab
2017-06-01 10:26 ` Martin Ågren
2017-06-01 10:33 ` Ævar Arnfjörð Bjarmason
2017-06-01 11:53 ` Martin Ågren
2017-06-01 15:57 ` Martin Ågren
2017-06-02 0:15 ` Junio C Hamano [this message]
2017-06-02 8:51 ` Ævar Arnfjörð Bjarmason
2017-06-02 9:49 ` Martin Ågren
2017-06-02 19:32 ` Ævar Arnfjörð Bjarmason
2017-06-02 20:11 ` Martin Ågren
2017-06-02 20:14 ` Ævar Arnfjörð Bjarmason
2017-06-02 20:25 ` demerphq
2017-06-02 20:17 ` demerphq
2017-06-02 20:38 ` Ævar Arnfjörð Bjarmason
2017-06-02 21:53 ` Linus Torvalds
2017-06-03 0:13 ` Junio C Hamano
2017-06-02 14:46 ` Liam R. Howlett
2017-06-02 16:53 ` Ævar Arnfjörð Bjarmason
2017-06-03 0:15 ` Junio C Hamano
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=xmqq37bj454a.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=larsxschneider@gmail.com \
--cc=marc@marc-stevens.nl \
--cc=martin.agren@gmail.com \
--cc=schwab@suse.de \
/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.