Re: [RFC][PATCH 6/6] objtool: Add IBT validation / fixups

Joao Moreira
2022-02-15T23:38:42Z

>>
>> Mostly so that we can deduce the address of the trap from the
>> retpoline
>> site, also the above has a fairly high chance of using jcc.d32 which
>> is
>> actually larger than jcc.d8+ud2.
>
> Ah, yeah, that's an interesting point.
>
> Still, I worry about finding ways to convinces Clang to emit precisely
> cmp/je/trap/call, but I guess we'll catch it immediately if it doesn't.
> :P

This can probably be done more easily/precisely if implemented directly
in the compiler's arch-specific backend. At least for x86 it wasn't a
hassle to emit a defined sequence of instructions in the past. The price
is that it will require a pass specific to each supported architecture,
but I guess this isn't that bad.

Perhaps this is discussion for a different mailing list, idk... but
just pointing that it is not a huge wall.