Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965379AbbD0Uel (ORCPT ); Mon, 27 Apr 2015 16:34:41 -0400 Received: from www62.your-server.de ([213.133.104.62]:59926 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965128AbbD0Ueh (ORCPT ); Mon, 27 Apr 2015 16:34:37 -0400 Message-ID: <553E9D56.1020202@iogearbox.net> Date: Mon, 27 Apr 2015 22:34:30 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Stephan Mueller CC: Hannes Frederic Sowa , mancha , tytso@mit.edu, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, dborkman@redhat.com Subject: Re: [BUG/PATCH] kernel RNG and its secrets References: <20150318095345.GA12923@zoho.com> <5527E22C.9080909@iogearbox.net> <2604864.n87lBBrmsR@tauon> <11353383.zL7vZDIZ69@tauon> In-Reply-To: <11353383.zL7vZDIZ69@tauon> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1095 Lines: 36 On 04/27/2015 09:10 PM, Stephan Mueller wrote: ... > I posted the issue on the clang mailing list on April 10 -- no word so far. I > would interpret this as a sign that it is a no-issue for them. Hm. ;) Here's a bug report on the topic, gcc vs llvm: https://llvm.org/bugs/show_bug.cgi?id=15495 Lets add a new barrier macro to linux/compiler{,-gcc}.h, f.e. #define barrier_data(ptr) __asm__ __volatile__("" : : "r" (ptr) : "memory") or the version Mancha proposed. You could wrap that ... #define OPTIMIZER_HIDE(ptr) barrier_data(ptr) ... and use that one for memzero_explicit() instead: void memzero_explicit(void *s, size_t count) { memset(s, 0, count); OPTIMIZER_HIDE(s); } It certainly needs comments explaining in what situations to use which OPTIMIZER_HIDE* variants, etc. Do you want to send a patch? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/