Closed kees closed 1 month ago
cc @ardbiesheuvel
RFCv2 sent to the list
https://lore.kernel.org/linux-arm-kernel/20220505161011.1801596-1-ardb@kernel.org/
This version is Clang only for the moment, as GCC has a DWARF generation issue where the CFI annotation is emitted for the wrong instruction. Other than that, the implementation is mostly complete, in the sense that it applies to both the core kernel and loadable modules, and that it checks PAC/BTI h/w support first, and gives up if either is supported (PAC makes SCS redundant, and BTI conflicts with code patching, as the PACIASP instruction is also a landing pad, and therefore needs to be retained)
CONFIG_DYNAMIC_SCS via commit 9beccca0984022a844850e32f0d7dd80d4a225de
Not all arm64 devices support PAC, so for a distro or GKI kernel, there needs to be a way to dynamically select SCS or PAC at runtime so there is no redundant work happening in the PAC case.
objtool
appears to be overkill for finding all the PAC/SCS instrumentation points, so a better approach is needed: https://lore.kernel.org/lkml/CAMj1kXF31FxCTbo4M8MX0aaegaq7AQXMUdCtsm6xrKUFSpkzjA@mail.gmail.com/