On Thu, Apr 14, 2016 at 05:38:08PM +0200, Stephan Mueller wrote: > > > I don't think this is really needed. memzero_explicit is used only on stack > > variables that get cleared just before they go out of scope. > > Are you so sure that a compiler is not getting smart on seeing a memset > followed by a free without marking the pointer as volatile? You free the > pointer immediately after memset(). I would not want to bet anything that a > compiler would leave the memset for non-volatile pointers. > > Besides, memzero_expicit does not cost anything -- it does not add any > instruction but convinces the compiler to not optimize it away. memzero_explicit is only meant for stack pointers, so there is no need to use it here. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- 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