Commit be0fffa5 authored by Peter Zijlstra's avatar Peter Zijlstra

x86/alternative: Rename apply_ibt_endbr()

The current name doesn't reflect what it does very well.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarSami Tolvanen <samitolvanen@google.com>
Link: https://lkml.kernel.org/r/20230622144321.427441595%40infradead.org
parent 0479a42d
...@@ -437,7 +437,7 @@ void __init arch_cpu_finalize_init(void) ...@@ -437,7 +437,7 @@ void __init arch_cpu_finalize_init(void)
os_check_bugs(); os_check_bugs();
} }
void apply_ibt_endbr(s32 *start, s32 *end) void apply_seal_endbr(s32 *start, s32 *end)
{ {
} }
......
...@@ -96,7 +96,7 @@ extern void alternative_instructions(void); ...@@ -96,7 +96,7 @@ extern void alternative_instructions(void);
extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
extern void apply_retpolines(s32 *start, s32 *end); extern void apply_retpolines(s32 *start, s32 *end);
extern void apply_returns(s32 *start, s32 *end); extern void apply_returns(s32 *start, s32 *end);
extern void apply_ibt_endbr(s32 *start, s32 *end); extern void apply_seal_endbr(s32 *start, s32 *end);
extern void apply_fineibt(s32 *start_retpoline, s32 *end_retpoine, extern void apply_fineibt(s32 *start_retpoline, s32 *end_retpoine,
s32 *start_cfi, s32 *end_cfi); s32 *start_cfi, s32 *end_cfi);
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
/* /*
* Create a dummy function pointer reference to prevent objtool from marking * Create a dummy function pointer reference to prevent objtool from marking
* the function as needing to be "sealed" (i.e. ENDBR converted to NOP by * the function as needing to be "sealed" (i.e. ENDBR converted to NOP by
* apply_ibt_endbr()). * apply_seal_endbr()).
*/ */
#define IBT_NOSEAL(fname) \ #define IBT_NOSEAL(fname) \
".pushsection .discard.ibt_endbr_noseal\n\t" \ ".pushsection .discard.ibt_endbr_noseal\n\t" \
......
...@@ -803,7 +803,7 @@ static void __init_or_module poison_endbr(void *addr, bool warn) ...@@ -803,7 +803,7 @@ static void __init_or_module poison_endbr(void *addr, bool warn)
/* /*
* Generated by: objtool --ibt * Generated by: objtool --ibt
*/ */
void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end) void __init_or_module noinline apply_seal_endbr(s32 *start, s32 *end)
{ {
s32 *s; s32 *s;
...@@ -818,7 +818,7 @@ void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end) ...@@ -818,7 +818,7 @@ void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end)
#else #else
void __init_or_module apply_ibt_endbr(s32 *start, s32 *end) { } void __init_or_module apply_seal_endbr(s32 *start, s32 *end) { }
#endif /* CONFIG_X86_KERNEL_IBT */ #endif /* CONFIG_X86_KERNEL_IBT */
...@@ -1565,7 +1565,10 @@ void __init alternative_instructions(void) ...@@ -1565,7 +1565,10 @@ void __init alternative_instructions(void)
*/ */
callthunks_patch_builtin_calls(); callthunks_patch_builtin_calls();
apply_ibt_endbr(__ibt_endbr_seal, __ibt_endbr_seal_end); /*
* Seal all functions that do not have their address taken.
*/
apply_seal_endbr(__ibt_endbr_seal, __ibt_endbr_seal_end);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* Patch to UP if other cpus not imminent. */ /* Patch to UP if other cpus not imminent. */
......
...@@ -358,7 +358,7 @@ int module_finalize(const Elf_Ehdr *hdr, ...@@ -358,7 +358,7 @@ int module_finalize(const Elf_Ehdr *hdr,
} }
if (ibt_endbr) { if (ibt_endbr) {
void *iseg = (void *)ibt_endbr->sh_addr; void *iseg = (void *)ibt_endbr->sh_addr;
apply_ibt_endbr(iseg, iseg + ibt_endbr->sh_size); apply_seal_endbr(iseg, iseg + ibt_endbr->sh_size);
} }
if (locks) { if (locks) {
void *lseg = (void *)locks->sh_addr; void *lseg = (void *)locks->sh_addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment