From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761996AbcLPP5v (ORCPT ); Fri, 16 Dec 2016 10:57:51 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:58402 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755331AbcLPP5m (ORCPT ); Fri, 16 Dec 2016 10:57:42 -0500 MIME-Version: 1.0 In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB0240E66@AcuExch.aculab.com> References: <20161215203003.31989-1-Jason@zx2c4.com> <20161215203003.31989-4-Jason@zx2c4.com> <063D6719AE5E284EB5DD2968C1650D6DB0240E66@AcuExch.aculab.com> From: "Jason A. Donenfeld" Date: Fri, 16 Dec 2016 16:57:38 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 3/4] secure_seq: use SipHash in place of MD5 To: David Laight Cc: Netdev , "kernel-hardening@lists.openwall.com" , LKML , "linux-crypto@vger.kernel.org" , Ted Tso , Hannes Frederic Sowa , Linus Torvalds , Eric Biggers , Tom Herbert , George Spelvin , Vegard Nossum , "ak@linux.intel.com" , "davem@davemloft.net" , "luto@amacapital.net" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On Fri, Dec 16, 2016 at 10:59 AM, David Laight wrote: > You are still putting over-aligned data on stack. > You only need to align it to the alignment of u64 (not the size of u64). > If an on-stack item has a stronger alignment requirement than the stack > the gcc has to generate two stack frames for the function. Yesterday, folks were saying that sometimes 32-bit platforms need 8-byte alignment for certain 64-bit operations, so I shouldn't fall back to 4-byte alignment there. But actually, looking at this more closely, I can just make SIPHASH_ALIGNMENT == __alignof__(u64), which will take care of all possible concerns, since gcc knows best which platforms need what alignment. Thanks for making this clear to me with "the alignment of u64 (not the size of u64)". > Oh - and wait a bit longer between revisions. Okay. We can be turtles. Jason