From: Linus Torvalds Subject: Re: [PATCH] treewide: Update sha_transform Date: Tue, 9 Aug 2011 08:41:00 -0700 Message-ID: References: <1312844837-10086-1-git-send-email-msb@chromium.org> <1312847115.1643.22.camel@Joe-Laptop> <20110809055226.GE6103@google.com> <1312880303.1676.5.camel@Joe-Laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Mandeep Singh Baines , linux-kernel@vger.kernel.org, Ramsay Jones , Nicolas Pitre , Joachim Eastwood , Andreas Schwab , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, GeertUytterhoeven To: Joe Perches Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:57376 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753230Ab1HIPlv (ORCPT ); Tue, 9 Aug 2011 11:41:51 -0400 In-Reply-To: <1312880303.1676.5.camel@Joe-Laptop> Sender: linux-crypto-owner@vger.kernel.org List-ID: On Tue, Aug 9, 2011 at 1:58 AM, Joe Perches wrote: > > Eliminate possible sha_transform unaligned accesses to data by copying > data to an aligned __u32 array if necessary. This is wrong. Not only does it double the stack space, when I tried it for git it just made things slower. So don't do it. If some architecture has a bad "get_unaligned_be32()", then that's just something for the arch maintainers to fix. > Add sha_transform wipe argument to force workspace clearing if desired. I disagree. As already mentioned, any competent compiler would make that thing go away anyway. And there is no reason to believe that it's actually a real fix for any real security issue, so it's voodoo programming for several reasons. We shouldn't do voodoo stuff. Or rather, I'm perfectly ok if you guys all do your little wax figures of me in the privacy of your own homes - freedom of religion and all that - but please don't do it in the kernel. Linus