On Mon, Oct 6, 2014 at 1:44 PM, Jason Cooper <jason@xxxxxxxxxxxxxx> wrote: > On Sat, Oct 04, 2014 at 11:09:40PM -0400, Sandy Harris wrote: >> There was recently a patch to the random driver to replace memset() >> because, according to the submitter, gcc sometimes optimises memset() >> away ... > memzero_explicit() is a good start, ... As I see it, memzero_explicit() is a rather ugly kluge, albeit an acceptable one in the circumstances. A real fix would make memset() do the right thing reliably; if the programmer puts in memset( x, 0, nbytes) then the memory should be cleared, no ifs or buts. I do not know or care if that means changes in the compiler or in the library code or even both, but the fix should make the standard library code work right, not require adding a new function and expecting everyone to use it. -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html