> > And it probably should be a more reliable method which we probably could
> > use to detect !retpolined modules too.
> 
> Andi actually implemented this, but it ended up being watered down
> somewhat.

It's enforced in mainline with the following patch

It's not fully bullet proof, but should be good enough to protect
against mistakes at least.

commit 6cfb521ac0d5b97470883ff9b7facae264b7ab12
Author: Andi Kleen <[email protected]>
Date:   Tue Jan 16 12:52:28 2018 -0800

    module: Add retpoline tag to VERMAGIC
    
    Add a marker for retpoline to the module VERMAGIC. This catches the case
    when a non RETPOLINE compiled module gets loaded into a retpoline kernel,
    making it insecure.
    
    It doesn't handle the case when retpoline has been runtime disabled.  Even
    in this case the match of the retcompile status will be enforced.  This
    implies that even with retpoline run time disabled all modules loaded need
    to be recompiled.



Reply via email to