From patchwork Mon Apr 15 13:43:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13630079 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 E1EA2C00A94 for ; Mon, 15 Apr 2024 13:43:59 +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:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1lERpYS8ac+IFHXZDhuYafpNWuSAzCnHwP5KbIjLudM=; b=lKUWXXU1oZbeCh D6wuw+z3LCkgitpLyMCdZmOHOUGLqxsdOzi6weT8UsgoeDbsmT0BFYtrUNx6dxKUaP0gcBc2H9NsF /9bkvsHNU0MCdR6N6lrUoM8aUNWI7D3e7stSs6KqTctGlrzG5DE6aabTgm+pR1TvFTDYW/6lYz7mv P6pdxqpmB1nyol3F6bTudJgXda3T50oUvwVDJeQsfE3eELzIqqIp9ju3v46Z7FbPncky7y04LzGFm ECbEXNk8z3A0kH/pfVUyMOnlxqFfUy5n3VWsYQqip/jl653Ezwx48sFeM2y1pBlm7SwLMJOMado4N bP3Q3khEuBW9tyyWpXEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwMch-00000008XVl-0FTj; Mon, 15 Apr 2024 13:43:51 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwMcU-00000008XNj-1Dyd for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 13:43:40 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-516cdb21b34so4080566e87.1 for ; Mon, 15 Apr 2024 06:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713188614; x=1713793414; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=B8O1l9DG1nr6tC/T09XllcDqc2JZrTHVCm6s1PJNYaY=; b=phd0DChLp2ItfL/UmGoPZzqZSTP25FLgq8GWTjfdIVGk7nMMCPhMqmLkiLVMfhisuT GowaXs4HpxX/fHJsWAL0FVE7JcGPhUgnP29AMICjClP21hUoxDhSCxqg5GyZmNJ92MbJ 7w6YJYdbn7mww40ddZqAo3IOTofgN6TVB8+nJ2llR2OQ/uI0fqGDT8MPpayoBp9jG4/I opc/+6vNqj2usS//iqYGz7tYLZebNjqvVtLx22DQEvAb5bSEEz4KzXqWscza6UpUmRPC eFwRM49GVzcznRCkBMx55lD4o/94IPQX+3qESy0HxAF4uVt+f9s1cJisnDdooontjD0W IIhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713188614; x=1713793414; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B8O1l9DG1nr6tC/T09XllcDqc2JZrTHVCm6s1PJNYaY=; b=mKRejbE2YyJ3a9QsG3s7tp56kDMaZEfxoo6S/rkfHWgMoeBHgYFRp6K71/O4pOcB2G rhG872wUory2ddqQLa7n+znZGx0KeSI5GDNBeEhQTqheza2t+SgKdmI/1wRFwlLSwmUz hyMoRttqMu6fkJqYR25Ign/XsBHfPUdX1XOHSPYyZTE9/ZgJGB5hFgjmnfnFHyuuZaob ZdAHygwp1/o1IJbBJRDpiS0kbV2hL9ARUftYMieDhfNexvYk52J1dVfvCaEECfsBdluY vhKNUpLlnKmsu2PWf9/1A7PEC0l+hI/Jc9zDyotPe/nzD63bNv65FxQBy28vZBnj6rp7 KCyA== X-Gm-Message-State: AOJu0Yy897UNZ67zzpimnuDp0GjNc+Dum7i5h3IVz9D9q8YctABFsBBB GDYGTKUXJFVTPlTi7s3ErT2eQ0v/AgC/057Fp+z0ECZu4nBQGc82K0mLE7y7JminLkSB0kpLtk2 x X-Google-Smtp-Source: AGHT+IF6TUlz0a11NQHsoRzwI88UyyMC+kUX4EKshRGzPvFLMfF6IpRGswBTL8JMScIUGA1nC8o8zg== X-Received: by 2002:a2e:a4ce:0:b0:2d6:ff58:179c with SMTP id p14-20020a2ea4ce000000b002d6ff58179cmr5144064ljm.27.1713188613994; Mon, 15 Apr 2024 06:43:33 -0700 (PDT) Received: from [192.168.1.140] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id p11-20020a2eb98b000000b002d43737e2d7sm1297988ljp.30.2024.04.15.06.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:43:33 -0700 (PDT) From: Linus Walleij Date: Mon, 15 Apr 2024 15:43:21 +0200 Subject: [PATCH v5 02/10] ARM: ftrace: Define ftrace_stub_graph MIME-Version: 1.0 Message-Id: <20240415-arm32-cfi-v5-2-ff11093eeccc@linaro.org> References: <20240415-arm32-cfi-v5-0-ff11093eeccc@linaro.org> In-Reply-To: <20240415-arm32-cfi-v5-0-ff11093eeccc@linaro.org> To: Russell King , Sami Tolvanen , Kees Cook , Nathan Chancellor , Nick Desaulniers , Ard Biesheuvel , Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, Linus Walleij X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_064338_391674_BC9C845F X-CRM114-Status: GOOD ( 10.69 ) 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 Several architectures defines this stub for the graph tracer, and it is needed for CFI, as it needs a separate symbol for it. The trick from include/asm-generic/vmlinux.lds.h to define ftrace_stub_graph to ftrace_stub isn't working when using CFI. Commit 883bbbffa5a4 contains the details. Tested-by: Kees Cook Signed-off-by: Linus Walleij --- arch/arm/kernel/entry-ftrace.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/kernel/entry-ftrace.S b/arch/arm/kernel/entry-ftrace.S index 3e7bcaca5e07..bc598e3d8dd2 100644 --- a/arch/arm/kernel/entry-ftrace.S +++ b/arch/arm/kernel/entry-ftrace.S @@ -271,6 +271,10 @@ ENTRY(ftrace_stub) ret lr ENDPROC(ftrace_stub) +ENTRY(ftrace_stub_graph) + ret lr +ENDPROC(ftrace_stub_graph) + #ifdef CONFIG_DYNAMIC_FTRACE __INIT