Re: [PATCH] retpoline/module: Taint kernel for missing retpoline in module

From: Greg KH
Date: Sat Jan 13 2018 - 10:38:23 EST


On Sat, Jan 13, 2018 at 06:53:00AM -0800, Andi Kleen wrote:
> > > When the a module hasn't been compiled with a retpoline
> > > aware compiler, print a warning and set a taint flag.
> >
> > Isn't that caught by the "build with a different compiler/version" check
> > that we have? Or used to have? If not, can't we just make it into that
>
> - the compiler version number may not change if a distribution backports
> the gcc changes for the new flag
> - the module might be using a custom make file that does not correctly
> set the flag, even if the compiler supports it
>
> > type of check to catch this type of problem no matter what type of
> > feature/option it is trying to catch?
>
> I suspect that would be far more complicated.

Really? As Arjan points out, just mix it into the modversion symbol
generation, that should cause it to be caught properly and trivially.

> Also what's the point of putting this information into every symbol?

It makes it easy to check :)

> Once per module is good enough.
>
> We already have similar checks for staging etc.

Sure, but this is more of a "Hey, your version of GCC is doing something
different than what you built the kernel with, watch out!" which is much
more generic and good to know. A whole taint for one CPU bug type seems
overkill to me.

thanks,

greg k-h