From 4ed9de9b27c39777b5b514b84bf7ea382d9288ce Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 12 Apr 2017 18:35:50 +0000 Subject: [PATCH] The kernel has to slightly different version of SipHash_Final but with the same bug as just fixed in userland: ---------- SipHash_Final() was assuming the digest was 64-bit aligned, resulting in misaligned memory accesses with armv7 ramdisk -Os bsd.rd ping ok florian millert ---------- OK deraadt@ --- sys/crypto/siphash.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/crypto/siphash.c b/sys/crypto/siphash.c index 478543096a0..1b3df7e3f1d 100644 --- a/sys/crypto/siphash.c +++ b/sys/crypto/siphash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siphash.c,v 1.3 2015/02/20 11:51:03 tedu Exp $ */ +/* $OpenBSD: siphash.c,v 1.4 2017/04/12 18:35:50 florian Exp $ */ /*- * Copyright (c) 2013 Andre Oppermann @@ -110,9 +110,8 @@ SipHash_Final(void *dst, SIPHASH_CTX *ctx, int rc, int rf) { uint64_t r; - r = SipHash_End(ctx, rc, rf); - - htolem64((uint64_t *)dst, r); + htolem64(&r, SipHash_End(ctx, rc, rf)); + memcpy(dst, &r, sizeof r); } uint64_t -- 2.20.1