Skip to content

Commit 481ee45

Browse files
brooniectmarinas
authored andcommitted
arm64: Unconditionally override SYM_FUNC macros
Currently we only override the SYM_FUNC macros when we need to insert BTI C into them, do this unconditionally to make it more likely that we'll notice bugs in our override. Suggested-by: Mark Rutland <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Mark Brown <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 9be34be commit 481ee45

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

arch/arm64/include/asm/linkage.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88

99
#define BTI_C bti c ;
1010

11+
#else
12+
13+
#define BTI_C
14+
15+
#endif
16+
1117
/*
12-
* When using in-kernel BTI we need to ensure that PCS-conformant assembly
13-
* functions have suitable annotations. Override SYM_FUNC_START to insert
14-
* a BTI landing pad at the start of everything.
18+
* When using in-kernel BTI we need to ensure that PCS-conformant
19+
* assembly functions have suitable annotations. Override
20+
* SYM_FUNC_START to insert a BTI landing pad at the start of
21+
* everything, the override is done unconditionally so we're more
22+
* likely to notice any drift from the overridden definitions.
1523
*/
1624
#define SYM_FUNC_START(name) \
1725
SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \
@@ -37,8 +45,6 @@
3745
SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \
3846
BTI_C
3947

40-
#endif
41-
4248
/*
4349
* Annotate a function as position independent, i.e., safe to be called before
4450
* the kernel virtual mapping is activated.

0 commit comments

Comments
 (0)