Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1177200rwn; Thu, 8 Sep 2022 14:58:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR42l0aSEyIC+dIatSQDH1w7X+HDacVO27nXmDY5YhLl+aN9SkWvj1uFF2sm2vrb2VnwIy8D X-Received: by 2002:a63:cd55:0:b0:42a:7649:77c7 with SMTP id a21-20020a63cd55000000b0042a764977c7mr9515769pgj.149.1662674318177; Thu, 08 Sep 2022 14:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662674318; cv=none; d=google.com; s=arc-20160816; b=Ssr1NBKhUeDDjWOFnJJn6HY9rMoKlBbQgndP3nLFzk3WQeQJuyNCswtFO4Z0w+PSoi VHtEk+2lUqw3+xdgR99jU5LfZxb/8dv21gdGWf48TgNfTG0GWUuXd/xvUfOeBhp84MlJ FoDpuv8LQYgwwrIZADD5c8OiApNmAp9lOOPsShQZKxTd+PbDBe41tZy4e9toM41lTlpM hdCM41Qt9Dn63R4Davb9XGZ2/CP3nSj8cNPWJ2UgiRgDvOJyfnJJjtruYLz1m/sQqVS4 ku4AxCyZD9J8TzXARgs5DTZ/BG8X4MzG3gOCmMgaII/tRVYUsjrmwK27JlBI9uGK/4qr h5Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=vm5veKXR+O2rRgDax5LpSkLTaTy6Og98Noar0uvmDBg=; b=c1z9dhT9e7zbXYm7i5JfCr/4kpz63lLiUJjq8gSO5sDKhOZCwFFHUNCy5owme3h8Ea JDU9XxI0utB7Afrdw4H8yc/f3jdx8NYwfMuok8FqmMo4023Bs/oFfNtJHvdz6Ay7IeRB F7IVrHeoCjlyOAebr9VZIeJY3ASWVyI6dRlOL5iBS0OEy7l+VVlwJqTf8sk4l8DlCDMO Krzp2SDzOBwgcfEW+RE8rB0vMKd5P0Q9zMmMhuKYlmqOwl2WNokRU2HtuTB+fExNGkCf Skf+4bg4YjWJ/2+etYDkuv1HQCa7rstFAv7o7YXhmm2tc4dRnY39Byi1LydtgA76+DBh AOLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ZH4pBF7G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t26-20020a65609a000000b0043634245eb4si3545014pgu.7.2022.09.08.14.58.25; Thu, 08 Sep 2022 14:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ZH4pBF7G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbiIHV5f (ORCPT + 99 others); Thu, 8 Sep 2022 17:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbiIHV4s (ORCPT ); Thu, 8 Sep 2022 17:56:48 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11AF212C4AC for ; Thu, 8 Sep 2022 14:55:55 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id 136-20020a63008e000000b0042d707c94fbso9720933pga.9 for ; Thu, 08 Sep 2022 14:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date; bh=vm5veKXR+O2rRgDax5LpSkLTaTy6Og98Noar0uvmDBg=; b=ZH4pBF7GcHnWh2rdS1M78dhaZ11K8L+Sgzed6KJoRLi3j8jXB817lSxBYasnKxh35l ZgnZlL9KZKdVv/EEmU4Tr+fZQkPdIzGmxpc5X5xhaFXzDlmMeZThq26jacwbWTgmbIt+ mEOWKEGQf60wrEwM3JZDw9Jzp39hksE1mVbxmtBIAb5U04hNo0rDQzSQy3qp0ANVY3Nx mKwCjtrn4M5SR6N3Ntr0p4SQUb7v7l9CLXjBfW3uSHAXgNiORV7YYLQU3pmYbuhWBylE YBOxayLfIlv8bl+W/GJkrVOltIx+Nqz+DUXVpTpgY3U82wYjYp/kQseaYZQPRushhMm5 TAOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=vm5veKXR+O2rRgDax5LpSkLTaTy6Og98Noar0uvmDBg=; b=Lb9EPQnAOHQ2NwsWpGV7/hzsbEyRz+2V8DPWNKd+RnI0KBHaPbpuSu/Q1dvTtx2O2X sg61F8ty45y3iu38aw4RA9iplp0WNXKlQ+TVPaf0UpkdcScT6o2xnyBZTZQPvVRPMbbp UB7VYVc5D4VXzHsiyuChSm0M8Lh2o8NrFa3s24aF1zHensx2lF+r8jE20dN/MFcPmQDw oFOMsptrY5QcWERJ55kKXe4r1E3WuHKjuaJ05MOBVfsSLcUnWd14H5SeGsNAeLYV+i9G kjkpzm33YuF5o0OaooALRVK0aSUTzW6+zhhN4qRn+95gdaG+HVycwIAgH30kkjKkrbMO Ue6w== X-Gm-Message-State: ACgBeo13uQtYyIv602IOxaloud4PBQ0/MQuM1XbXBvnKprviET6CNvXB N1IqoWKEzD2omP3Ln6/THIQvBxvF5U9H3MXIwE2FVv+XgHtu/2K/xHv3pX3NROV9Xm7hZ9a3PNe lRXhsHmow2YubgRT1348tmo6jyVgm6Rh5qUq+BpD+iUCaeYrnpduet7nnLcZeXJU/K0p3zTUtDf rXjcoYPmU8Cg== X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:a4e4:e6ec:9fdd:1bdd]) (user=samitolvanen job=sendgmr) by 2002:a05:6a00:1390:b0:540:b6b6:e978 with SMTP id t16-20020a056a00139000b00540b6b6e978mr3321390pfg.8.1662674154442; Thu, 08 Sep 2022 14:55:54 -0700 (PDT) Date: Thu, 8 Sep 2022 14:55:00 -0700 In-Reply-To: <20220908215504.3686827-1-samitolvanen@google.com> Message-Id: <20220908215504.3686827-19-samitolvanen@google.com> Mime-Version: 1.0 References: <20220908215504.3686827-1-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=1418; i=samitolvanen@google.com; h=from:subject; bh=9OoxBGSeValXYdhbTF14Jfw3MpaGMV549rycOq8LEaw=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBjGmS2qkSmjV+l0koJEkW3Ra86NWCQbdAoQUKsCsKu US5kAIeJAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCYxpktgAKCRBMtfaEi7xW7pPDDA Cn2pbnV5bcnzoGc8JddgQnV8D4DQRGk/vp6Uu/MGcpttE+hmRYXGnxPteqSuac3HNTSxdxiMaQbfi4 tBYcvtA6mZVp5tIWr3/aPPuCXplinZdK/00vI41ck/OgxL6dJAJOalxRJzlbGGoQcXuHN2qEF0xHTr /m3yfieyINfDIDo4hlAU5NQcvyjTWGcpk1tkvYoRl3NFUC5Tcu91qUajnAkFemmoRTlvav6BDdgLve 6I7D1tpAsuiRpM7MiIB9WdPztgJcnq3wGcE5+hlQyM3NNPYVKNJRkBwUyTGRzbOQ5MNHbAUE/uYTuZ UXkp9zyheMNGsyjM8WiRweAG84GbTPpJfv2qdX2QzOuq8OeMyHCx3/gNnAHfS3cz+ZwsyKBUTB95XM /xIO9SBobBIFVshdiOGryKwpvtyHrmgoTm36g2d0vRyq+zF59jNJhd4zf6kaJcYjXsGyh4SAyVxQtH 4CwhKkIc22A/byAV/q1kus+z4aFPKT0NFo0RM2dCxr0y4= X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Subject: [PATCH v5 18/22] kallsyms: Drop CONFIG_CFI_CLANG workarounds From: Sami Tolvanen To: linux-kernel@vger.kernel.org Cc: Kees Cook , Josh Poimboeuf , Peter Zijlstra , x86@kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, Sami Tolvanen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Tested-by: Nathan Chancellor --- kernel/kallsyms.c | 17 ----------------- 1 file changed, 17 deletions(-) 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; } -- 2.37.2.789.g6183377224-goog