Skip to content

Commit dfb352a

Browse files
samitolvanenkees
authored andcommitted
kallsyms: Drop CONFIG_CFI_CLANG workarounds
With -fsanitize=kcfi, the compiler no longer renames static functions with CONFIG_CFI_CLANG + ThinLTO. Drop the code that cleans up the ThinLTO hash from the function names. Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Kees Cook <[email protected]> Tested-by: Kees Cook <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3c68a92 commit dfb352a

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

kernel/kallsyms.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -159,30 +159,13 @@ static bool cleanup_symbol_name(char *s)
159159
* character in an identifier in C. Suffixes observed:
160160
* - foo.llvm.[0-9a-f]+
161161
* - foo.[0-9a-f]+
162-
* - foo.[0-9a-f]+.cfi_jt
163162
*/
164163
res = strchr(s, '.');
165164
if (res) {
166165
*res = '\0';
167166
return true;
168167
}
169168

170-
if (!IS_ENABLED(CONFIG_CFI_CLANG) ||
171-
!IS_ENABLED(CONFIG_LTO_CLANG_THIN) ||
172-
CONFIG_CLANG_VERSION >= 130000)
173-
return false;
174-
175-
/*
176-
* Prior to LLVM 13, the following suffixes were observed when thinLTO
177-
* and CFI are both enabled:
178-
* - foo$[0-9]+
179-
*/
180-
res = strrchr(s, '$');
181-
if (res) {
182-
*res = '\0';
183-
return true;
184-
}
185-
186169
return false;
187170
}
188171

0 commit comments

Comments
 (0)