diff options
author | Juergen Gross <[email protected]> | 2023-12-10 07:21:36 +0100 |
---|---|---|
committer | Borislav Petkov (AMD) <[email protected]> | 2023-12-10 20:49:20 +0100 |
commit | da0fe6e68e104f79c1fef5c62a17bdd1634ea61c (patch) | |
tree | 4230eed7ba62d514a4052f3cfbc47027e39a4a1a /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | 9824b00c2b58f9e1072ef3ece571a2cfc71089d4 (diff) |
x86/alternative: Add indirect call patching
In order to prepare replacing of paravirt patching with alternative
patching, add the capability to replace an indirect call with a direct
one.
This is done via a new flag ALT_FLAG_CALL as the target of the CALL
instruction needs to be evaluated using the value of the location
addressed by the indirect call.
For convenience, add a macro for a default CALL instruction. In case it
is being used without the new flag being set, it will result in a BUG()
when being executed. As in most cases, the feature used will be
X86_FEATURE_ALWAYS so add another macro ALT_CALL_ALWAYS usable for the
flags parameter of the ALTERNATIVE macros.
For a complete replacement, handle the special cases of calling a nop
function and an indirect call of NULL the same way as paravirt does.
[ bp: Massage commit message, fixup the debug output and clarify flow
more. ]
Co-developed-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions