On 02/22/2018 07:38 AM, Jan Hubicka wrote: >>>> >>>> Hi Jan, >>>> >>>> https://gcc.gnu.org/ml/gcc-patches/2018-01/msg02233.html >>>> >>>> Is OK for trunk? >>> >>> I see that using register makes the problem go away and pushing address to >>> stack >>> seemed bit odd anyway. However how does this work on other types of thunk? >> >> Kernel only uses -mindirect-branch=thunk-extern. I am working on a proposal >> to use -mindirect-branch=thunk-extern in user space to support CET in a >> single >> binary. So at the end of the day, only >> -mindirect-branch=thunk-extern will be used. > > OK, so it is about the fact that we do not really want to support all > -mindirect-branch options in the future? If we don't want to support the > correctly, > I wonder why we are including them at all. Shall we at least output > warning/sorry > when user tries other thunk type with stack unwinding enabled? > (does Kernel use it?) A few notes.
1. It's not even clear at this time that retpolining user space binaries makes any sense at all. SO before doing anything to make this easier I'd like to see a justification for why it's really needed. 2. On the other hand, the existing thunk options do make it easier to test independent of hte kernel. ie, I can turn on inline thunks by default and test things in user space (ie, do thunks generally work properly). Jeff