From patchwork Tue Aug 30 23:31:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 12960161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50B6AECAAA1 for ; Wed, 31 Aug 2022 00:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9Z9sNTGo+ga7hbePfua9WSOc8LOnSWPOVYAnKVk/xwc=; b=Q70Uskfzl+Wnd6LOtVtqbcp1Pt QpKY1M9tXFo4GWxfzAUp/0CPC9ONvB9dja78XtW2kqBDWhLdqjOSllv43cdHHKjOfEpyk2je0Ej8E gAsy/Z+ydildgyiB6BLbwayDTZwOuObENx42cFgK4fqN9s4CwarkvmhrXdAa3GrP0ZOVZUpYgi/nw DoPSicKl4JExYazeTkfJ51vUBP1QrkAJHXxfA+ZeGo3WbEq+t2jKewNVRxIepMlkb+bzROlAafQf7 /ImQNMQb1hfXjQ7ei7DSE21CDiGk3rgv5Apfid5PZuCdyYuns/41oO0uDHETbOPRgBzkQrKyqRqh1 4noiwcgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTBCO-002bfJ-Jh; Wed, 31 Aug 2022 00:03:16 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTBCN-002bel-4i for linux-arm-kernel@bombadil.infradead.org; Wed, 31 Aug 2022 00:03:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Cc:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dj50MXIaDJBD96/1Gdf430/wXU4xb7a84h2xVZMa0Ew=; b=lRDQOVov76bbe+FVCLhyXQehlm fNCcf7RRfr1mJAXIka4ypGIcuvrDoEr52eUVaZc3+r7xfHzW+uacy6twdubkLxqGk+3sunqOleDN7 EG4Tpvcq/iGYd0ru9Ms2oYpbADQLMNx8K4V58LGkp4VQ0d4NYRwG3Dd/34ld1/R3DlHeMLFSfAVvz KWuhxup5hy9R0hsCh8eL9+SoaG6YB54sCkcC1Kd7oXyR8MGj5lnm+RfMB6C5dhqkKwt8fnPQ3b0Jy j/qeXGePBIwYVPYMGPBUudk0BunmgZFwKjDZg/J6O0teU0OjJByjlSSxZJ8xa2T6pN9xKfUWIkwXk tFnf6sNw==; Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTAiW-007zky-6M for linux-arm-kernel@lists.infradead.org; Tue, 30 Aug 2022 23:32:25 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-340862314d9so174971247b3.3 for ; Tue, 30 Aug 2022 16:32:23 -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=dj50MXIaDJBD96/1Gdf430/wXU4xb7a84h2xVZMa0Ew=; b=Qy/xMjE+Z9tI/RI2eW9aQXEE+x9bgipZmkl1TRFX4nG3lQ2Cxw/MGc9YBEMVb79P8x K7ZB6jWVCCidlAiCQ0KHSLobGlEUBTBOYT+IN2cosr4rJjNKEzJDFeo0nWGSZgVhOFnN LnJtK+KQLFx71PgotB16ka4GRRJjpTFnPNLg7HhkuXjEppj+KAqhY9tM//ZHz2AfaJ4E ojP4CyQHCBUPqv0EbNTJy1R5yPCLjtX4xD1E5S+rzObYF7P/nQl/buKNJiO0O+4YpcJO KWS4peUjbZVcIeXOVLV02EwcnTADwVU+JJD9CdooT51s51cyuvBlc8byyEyM9/c9zYEC TUsw== 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=dj50MXIaDJBD96/1Gdf430/wXU4xb7a84h2xVZMa0Ew=; b=czD4OuCxNHZwNo7VS7NJi3Nkj2tgw8bIbZ6Klsh66aJJ9V+4LsWbEFHOcK0gl1d9He 8K2AUYiYmWRPBnsp2ubA1XN6lXI6ijnw0456J2IQ9FGcaM7Abxv49czj4foa/NKZjYf2 OSntSp7zDbT3ZiYscw/5Wc737pziE0PDS6byoIkb/sNkLFrwKvib49ZAzvTipcixU+mL xVkX/teuQOPeWKss9VUAVpt16zwi0QlPnAQmWoBApGSuVcJOaSUv5xQKq9NVZVwk2yWt 3UnWH8UIw+VKlK7DHHaDDHaAREzeMH1My+VOdo8n45188xDv2PrG+3wtBqFVLmLRm+k3 CcqA== X-Gm-Message-State: ACgBeo0fFsuAQvgJqfYA4i05IXBRO3Zv/rzOrUM4VtHrRWgvDykOsdtk 022koYMwJyvf4yeFVhXR7qkgRnymMwRD8WEMS48= X-Google-Smtp-Source: AA6agR5LroJ1DHbPpfH8aFh9/G1HMs3AO252ceiCeo1jPAZmf7JXzZYp5Fa4eHZtuGTExuaU7+SLdODaNccTaYcpsSo= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:54d9:7143:6a7d:91d]) (user=samitolvanen job=sendgmr) by 2002:a05:6902:1206:b0:676:e465:24b1 with SMTP id s6-20020a056902120600b00676e46524b1mr13676826ybu.323.1661902342496; Tue, 30 Aug 2022 16:32:22 -0700 (PDT) Date: Tue, 30 Aug 2022 16:31:26 -0700 In-Reply-To: <20220830233129.30610-1-samitolvanen@google.com> Message-Id: <20220830233129.30610-19-samitolvanen@google.com> Mime-Version: 1.0 References: <20220830233129.30610-1-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=804; i=samitolvanen@google.com; h=from:subject; bh=PQGbduDYSHEunY6Nux9oR4b8gX3kqUUQ66z3bs0DO/k=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBjDp3OHJOh3MpkrcMboNL3mLB+U7xNHC0btjo7mME4 CgYIObyJAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCYw6dzgAKCRBMtfaEi7xW7ibxC/ 9u8tiBUAu11iMi2jQxB88ZoyRd3XcPtlmEJ49ZT4ibCRTKCQwU7x7cDMnDG2jMK91BvisB+yihmg9w N/xNoX9Du1hqgmpQ189vSRzZ8B3cTextiO0ei30mC5sYpY4O7ZzhfZ2RUhJ9GhDyhAqAEf/dyh6i7R slJI0p2V7MK2rO8Z0jyvl0g73TadyQ3IuIyhqfnc0JWw795W5qT0rTDncrsYsDg9bHqVA69umBLW/E JBpKqxPr5+1G3RypfC6VZNWayPrVcMVECCxIeWoI8JfgWyBD5zQ2Zeyjo3El1kUNH/J3pinc2ucgj0 nCmZucarH0zhjvQSUJC5X8OSCGQyDJClv+hqBEIWhQ0gvLN9UVnXd5Ql7r49YFrN1kk9AWrqjbQ3Sc AD5ZEd5SjOGYRv3rAgmv+XiFslu7d+xB6EyKfNX1+EmfFdYMhyVFQNijCiaFZSRvXJJ7dnhc8wF96j FE3UOfpxc1eA3nQd4sJS9gasOaTmoIocuonggQXaz5kqM= X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Subject: [PATCH v4 18/21] x86/tools/relocs: Ignore __kcfi_typeid_ relocations 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220831_003224_421887_4A24C804 X-CRM114-Status: GOOD ( 10.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The compiler generates __kcfi_typeid_ symbols for annotating assembly functions with type information. These are constants that can be referenced in assembly code and are resolved by the linker. Ignore them in relocs. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook --- arch/x86/tools/relocs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c index e2c5b296120d..2925074b9a58 100644 --- a/arch/x86/tools/relocs.c +++ b/arch/x86/tools/relocs.c @@ -56,6 +56,7 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = { "^(xen_irq_disable_direct_reloc$|" "xen_save_fl_direct_reloc$|" "VDSO|" + "__kcfi_typeid_|" "__crc_)", /*