From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Ryabitsev Date: Thu, 01 Sep 2022 15:29:02 -0400 Subject: [PATCH v5 17/21] kallsyms: Drop CONFIG_CFI_CLANG workarounds MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20220901-kcfi_support-v5-17-be2007d8da63@linuxfoundation.org> References: <20220901-kcfi_support-v5-0-be2007d8da63@linuxfoundation.org> In-Reply-To: <20220901-kcfi_support-v5-0-be2007d8da63@linuxfoundation.org> To: mricon@kernel.org X-Mailer: b4 0.10.0-dev-03aea X-Developer-Signature: v=1; a=openpgp-sha256; l=1280; i=konstantin@linuxfoundation.org; h=from:subject:message-id; bh=O18i3r5CGr1t/dYMbNXG0m9J5jEQNbepIxCYWdvskpI=; b=owGbwMvMwCW27YjM47CUmTmMp9WSGJIF2X8faA41aOq7ei7wvtwhI4nngtZL1qp6zOsOltBlrdiq 8kuzo5SFQYyLQVZMkaVsX+ymoMKHHnLpPaYwc1iZQIYwcHEKwESuZDD84c9KOnsrrCQ4bPnfyknGVY pLBbSOvsxlf772jNhhgfpfcowMm55aHZxgt+7u8ugH51OPrt/642DG7Flr7p9RF8rjebjwDyMA X-Developer-Key: i=konstantin@linuxfoundation.org; a=openpgp; fpr=DE0E66E32F1FDD0902666B96E63EDCA9329DD07E X-Endpoint-Received: by B4 Submission Endpoint for konstantin@linuxfoundation.org/default with auth_id=3 List-Id: B4 Web Endpoint Patches From: Sami Tolvanen 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 Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Tested-by: Kees Cook diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 3e7e2c2ad2f7..b27e6ea31f8b 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -159,7 +159,6 @@ static bool cleanup_symbol_name(char *s) * character in an identifier in C. Suffixes observed: * - foo.llvm.[0-9a-f]+ * - foo.[0-9a-f]+ - * - foo.[0-9a-f]+.cfi_jt */ res = strchr(s, '.'); if (res) { @@ -167,22 +166,6 @@ static bool cleanup_symbol_name(char *s) return true; } - if (!IS_ENABLED(CONFIG_CFI_CLANG) || - !IS_ENABLED(CONFIG_LTO_CLANG_THIN) || - CONFIG_CLANG_VERSION >= 130000) - return false; - - /* - * Prior to LLVM 13, the following suffixes were observed when thinLTO - * and CFI are both enabled: - * - foo$[0-9]+ - */ - res = strrchr(s, '$'); - if (res) { - *res = '\0'; - return true; - } - return false; } -- b4 0.10.0-dev-03aea