On Thu, Jul 30, 2020 at 11:24:44AM -0700, Linus Torvalds wrote: > On Wed, Jul 29, 2020 at 8:17 PM Kees Cook <keescook@xxxxxxxxxxxx> wrote: > > > > I'll look into this more tomorrow. (But yes, __latent_entropy is > > absolutely used for globals already, as you found, but this is the first > > percpu it was applied to...) > > Note that it was always per-cpu. > > The only thing that changed was that it was declared static in > lib/random.c vs being externally visible. Yup, thanks. I realized that a bit after sending my email. :) > Unrelated side note: I notice that the plugins could be simplified a > bit now that we require gcc 4.9 or later. There's a fair amount of > cruft for the earlier gcc versions. Yup -- Masahiro keeps poking the build system, but I haven't cleaned up the header file macros to keep up with the recent jumps. (It falls a bit low on my TODO list since it's a bit of a mechanical cleanup. I'm open to anyone that would like to send patches, though!) > I'm not sure how seriously the gcc plugins are actually maintained (no > offense) aside from just keeping them limping along. Does anybody > actually use them in production? I thought google had mostly moved on > to clang. They're part of regular testing, and there is ongoing development (e.g. see Alex Popov's recent series[1], which is in -next waiting for the v5.9 merge window). I hear regularly from folks using randstruct, stackleak, structleak, and latent_entropy. But yes, Google has moved to Clang where we're using Clang's implementation of structleak (auto-var-init) but there has been work to get randstruct ported (as desired by at least one Android vendor), though it's currently stalled. -Kees [1] https://lore.kernel.org/lkml/20200624123330.83226-1-alex.popov@xxxxxxxxx/ -- Kees Cook