"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
"Todd C. Miller" <Todd.Miller@sudo.ws>
Subject:
Re: MurmurHash2 unaligned access
To:
Stefan Sperling <stsp@stsp.name>
Cc:
Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Thu, 14 Oct 2021 08:47:01 -0600

Download raw body.

Thread
On Thu, 14 Oct 2021 14:36:24 +0200, Stefan Sperling wrote:

> I have tried a few things but I cannot get the current in-tree code
> to fault on sparc64. Neither my 'got he -l' test and a toy program I wrote
> managed to trigger the issue. Just out of curiousity, can you produce a short
> program that calls murmurhash2 and triggers an alignment fault on sparc64,
> octeon, or similar platforms?

Because struct got_object_id has sha1[] as the first (well, only)
element you probably end up with proper alignment.  It is best not
to rely on that though since a future change could change it.

> In any case, given how the SHA1Update() function in libc works, this
> patch should avoid any alignment issues.

OK millert@

 - todd