From mboxrd@z Thu Jan 1 00:00:00 1970 From: Herbert Xu Subject: Re: x86-64: Maintain 16-byte stack alignment Date: Wed, 11 Jan 2017 12:35:41 +0800 Message-ID: <20170111043541.GA4944@gondor.apana.org.au> References: <20170110143340.GA3787@gondor.apana.org.au> <20170110143913.GA3822@gondor.apana.org.au> <20170111031124.GA4515@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linux Kernel Mailing List , Linux Crypto Mailing List , Ingo Molnar , Thomas Gleixner , Andy Lutomirski , Ard Biesheuvel To: Linus Torvalds Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org On Tue, Jan 10, 2017 at 08:17:17PM -0800, Linus Torvalds wrote: > > That said, I do think that the "don't assume stack alignment, do it by > hand" may be the safer thing. Because who knows what the random rules > will be on other architectures. Sure we can ban the use of attribute aligned on stacks. But what about indirect uses through structures? For example, if someone does struct foo { } __attribute__ ((__aligned__(16))); int bar(...) { struct foo f; return baz(&f); } then baz will end up with an unaligned argument. The worst part is that it is not at all obvious to the person writing the function bar. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt