Your message dated Tue, 25 Oct 2016 00:35:25 +0000
with message-id <e1bypi9-0006kc...@franck.debian.org>
and subject line Bug#841983: fixed in haskell-cryptonite 0.20-3
has caused the Debian Bug report #841983,
regarding haskell-cryptonite: Fix alignment of blocks in sha3_update()
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
841983: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841983
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: haskell-cryptonite
Version: 0.20-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu zesty ubuntu-patch

Hi Clint,

In Ubuntu, we've observed a build failure of haskell-cryptonite on armhf
owing to the fact that our armhf builders run on an arm64 kernel which
raises SIGBUS on unaligned access.  While most of the hash implementations
have compatible alignment assumptions, SHA3 uses 64-bit blocks, which
triggers this problem.

Please consider applying the attached patch to the Debian package.

Strangely, it appears that this build failure is unrelated to the build
failure seen on sparc64; so this only benefits users who happen to have the
same set of kernel settings for armhf on Debian.  (It's possible that
skipping the unaligned traps is also a performance benefit, but that's
probably not true on all architectures and I have not tried to measure the
effect.)

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru haskell-cryptonite-0.20/debian/patches/crypto-buffer-alignment.patch haskell-cryptonite-0.20/debian/patches/crypto-buffer-alignment.patch
--- haskell-cryptonite-0.20/debian/patches/crypto-buffer-alignment.patch	1969-12-31 16:00:00.000000000 -0800
+++ haskell-cryptonite-0.20/debian/patches/crypto-buffer-alignment.patch	2016-10-24 16:53:07.000000000 -0700
@@ -0,0 +1,51 @@
+Author: Steve Langasek <steve.langa...@ubuntu.com>
+Description: fix alignment of memory blocks used by SHA3
+ SHA3 works in 64-bit chunks, but the incoming data pointer can be at any
+ address.  Copy our data to an aligned address, to avoid SIGBUS on certain
+ platforms.
+ .
+ This is not the only alignment issue in the code, but it is the one that
+ manifests as SIGBUS on the most architectures.
+
+Index: haskell-cryptonite-0.20/cbits/cryptonite_sha3.c
+===================================================================
+--- haskell-cryptonite-0.20.orig/cbits/cryptonite_sha3.c
++++ haskell-cryptonite-0.20/cbits/cryptonite_sha3.c
+@@ -23,6 +23,7 @@
+  */
+ 
+ #include <stdint.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include "cryptonite_bitfn.h"
+ #include "cryptonite_sha3.h"
+@@ -107,6 +108,7 @@ void cryptonite_sha3_init(struct sha3_ct
+ void cryptonite_sha3_update(struct sha3_ctx *ctx, const uint8_t *data, uint32_t len)
+ {
+ 	uint32_t to_fill;
++	uint64_t *data_aligned = NULL;
+ 
+ 	to_fill = ctx->bufsz - ctx->bufindex;
+ 
+@@ -124,6 +126,13 @@ void cryptonite_sha3_update(struct sha3_
+ 		ctx->bufindex = 0;
+ 	}
+ 
++	/* fix up alignment if necessary */
++	if (len && (unsigned long) data & 7) {
++		data_aligned = malloc(len);
++		memcpy(data_aligned, data, len);
++		data = (uint8_t *) data_aligned;
++	}
++
+ 	/* process as much ctx->bufsz-block */
+ 	for (; len >= ctx->bufsz; len -= ctx->bufsz, data += ctx->bufsz)
+ 		sha3_do_chunk(ctx->state, (uint64_t *) data, ctx->bufsz / 8);
+@@ -133,6 +142,7 @@ void cryptonite_sha3_update(struct sha3_
+ 		memcpy(ctx->buf + ctx->bufindex, data, len);
+ 		ctx->bufindex += len;
+ 	}
++	free(data_aligned);
+ }
+ 
+ void cryptonite_sha3_finalize(struct sha3_ctx *ctx, uint32_t hashlen, uint8_t *out)
diff -Nru haskell-cryptonite-0.20/debian/patches/series haskell-cryptonite-0.20/debian/patches/series
--- haskell-cryptonite-0.20/debian/patches/series	1969-12-31 16:00:00.000000000 -0800
+++ haskell-cryptonite-0.20/debian/patches/series	2016-10-24 16:53:06.000000000 -0700
@@ -0,0 +1 @@
+crypto-buffer-alignment.patch

--- End Message ---
--- Begin Message ---
Source: haskell-cryptonite
Source-Version: 0.20-3

We believe that the bug you reported is fixed in the latest version of
haskell-cryptonite, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 841...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Clint Adams <cl...@debian.org> (supplier of updated haskell-cryptonite package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 24 Oct 2016 20:08:40 -0400
Source: haskell-cryptonite
Binary: libghc-cryptonite-dev libghc-cryptonite-prof libghc-cryptonite-doc
Architecture: source
Version: 0.20-3
Distribution: experimental
Urgency: medium
Maintainer: Debian Haskell Group 
<pkg-haskell-maintainers@lists.alioth.debian.org>
Changed-By: Clint Adams <cl...@debian.org>
Description:
 libghc-cryptonite-dev - ${haskell:ShortDescription}${haskell:ShortBlurb}
 libghc-cryptonite-doc - ${haskell:ShortDescription}${haskell:ShortBlurb}
 libghc-cryptonite-prof - ${haskell:ShortDescription}${haskell:ShortBlurb}
Closes: 841983
Changes:
 haskell-cryptonite (0.20-3) experimental; urgency=medium
 .
   * Patch from Steve Langasek to fix alignment of blocks
     in sha3_update().  closes: #841983.
Checksums-Sha1:
 9afde492259c4a103bd2689769cb483ffebeb3a8 2672 haskell-cryptonite_0.20-3.dsc
 081f342d5c6d7c8c63901282d7b32a46a02b827d 582541 
haskell-cryptonite_0.20.orig.tar.gz
 62c26618f03859ec412447fe26783c15e35db748 4184 
haskell-cryptonite_0.20-3.debian.tar.xz
Checksums-Sha256:
 8c77be1b0c920b3f1181a87c193051a868f61e3acf3c7904835fb720e385f932 2672 
haskell-cryptonite_0.20-3.dsc
 261bfac4e032f24658a31d8c34abd0c0f64f9de07be69ad43a9139a7c0b5c354 582541 
haskell-cryptonite_0.20.orig.tar.gz
 b3ed7bd5551e671e517e9720ee42a6ee1b1b34fb6303dde5c57068476036759a 4184 
haskell-cryptonite_0.20-3.debian.tar.xz
Files:
 a0a87ff7a42ae9e3210ee2f0e7e53d36 2672 haskell extra 
haskell-cryptonite_0.20-3.dsc
 0de738cd70188dd8b4064c4af703e56c 582541 haskell extra 
haskell-cryptonite_0.20.orig.tar.gz
 9d3119476637a5da92c0461d45be9c1e 4184 haskell extra 
haskell-cryptonite_0.20-3.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Comment: Debian!

iQKOBAEBCgB4BQJYDqLqXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ3NTgxRUM4NzQwNTNFNkM4MDc3OTFCOUI1
NTkyMzMxRTE5OUQzOEE4ERxjbGludEBkZWJpYW4ub3JnAAoJEFWSMx4ZnTioPrMP
/j+ncPDlE6enevHmpPJcj6ebhc0wPyu9bg4Myu4JuY3v31UUGd0wzMIwj3vFGnuT
+FCWn1GvYIJKZn54sLf4iRmVVKLirrVYSBqsLAK8F2hcGn5QCJxVLIt9PV3yKd6R
PSCJ8s8bz9k6TzgTQSgG4dKhu2bNGUJE6iErcAsnf29zcAFu0i3VSXPB68x4EXOI
VNEnDK7X1wUMrPF0QCavQWJCHwM/1mBCVg0F1MEQPydpqIroowIHmvMUfDAoEzcl
y3GkAcpyN8pROG2gyrlqwYjyffufYcw229bjIPq1ORiu4DJaN65z/Piep3Esx5Ce
7H7nk33qxpaxYhPffuCOienOsqwHXyC0LSRbMlvf5jwe5vOScAKKp7xEpZDt4Ic4
qEiyG60p+IR+E0DNEOVc0u4Us8DYaKA5RY/obz2N1grtK87ZDV34DJ50T6m10TVP
1x4RI7OLdDKW9yu/ljf5COPewHD0jZsW65Xaec/scg0IoDC5izD6IJ1FPm5wJPKb
D06w+LiM1WbPY/EPRsQ1rKFv6FAl5Idm7rYsFeEYIrWX19t8/soIYHhngFReO0MS
PYGp04titZfalFihoEksQ4Pn3i1y1Z9lO/sFMjE1LtbcrxdHDd3KSBwY3xBFpvyj
rEKHbbHRozGOnM4MA+eGko2MaZmMXVxs5Ikt9RUbFun8
=HQZU
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Pkg-haskell-maintainers mailing list
Pkg-haskell-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-haskell-maintainers

Reply via email to