From patchwork Mon Jun 14 22:32:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 1491888 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=U5o8vt6G; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G3mVv077Jz9sW7 for ; Tue, 15 Jun 2021 08:35:35 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21C1C3893646 for ; Mon, 14 Jun 2021 22:35:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21C1C3893646 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623710132; bh=4yCmun+k9w10xlAv8Q5ssMer4f8rS0c9eTHLCNH4rAE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=U5o8vt6GTPq3/wdiAhlYpNRzZQ+EiE1bhFQbq7zKudj+FxTxooGJG3E19f6SbXbj/ IudMU/TXWGHOCHhti3tlvykPKncPhECPmbp2R0HjbjVtVtN0ZaQNJzO5CZEKZgGpIe FxYzFQPuAuJjVuIl4nJyKS1tIokMQZXpcLZ3ykXo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by sourceware.org (Postfix) with ESMTPS id 670DB388CC12 for ; Mon, 14 Jun 2021 22:33:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 670DB388CC12 Received: by mail.kernel.org (Postfix) with ESMTPSA id 02B52611CE; Mon, 14 Jun 2021 22:33:11 +0000 (UTC) To: Catalin Marinas , Will Deacon Subject: [PATCH v3 3/4] elf: Remove has_interp property from arch_adjust_elf_prot() Date: Mon, 14 Jun 2021 23:32:13 +0100 Message-Id: <20210614223214.39011-4-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210614223214.39011-1-broonie@kernel.org> References: <20210614223214.39011-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2151; h=from:subject; bh=fCxAxBsrdCysAQR8O0YHtW9cXxwUrKw65hU1mQ0qWk0=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBgx9jscT/tjOsyDA4fqAk63t8+zhdRqo/okAQGtBab 6GkwKRSJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYMfY7AAKCRAk1otyXVSH0Fv8B/ 9n4MxOkwE08+s1KuYDbXW8HmGkcSrRsnbokMnx4O6yqCfYunlNP76yiYDisbWcziywvhtxfnNfd3pG MYFI38kzyTwwFnUI+avkO91uGTO1ywrvkZ67dJ+h+cfIK/FJDWy5v3ZGvmeAIZPwqUgtZ16HDp75PD ckdcB5aWS9v8nFz5mMJYUPBcpX7ZqmkNSqJlwoJ3qc4gx4jqYMKuh6PDucY6ZsCa7Qnu/8Qfig+4jL DYu83xz4morL6efeTNRbXvgPcD+gECGDAck4Ty62ZNxVeqK7yKCoilNmzgWQh3cKmFaW/tE9e3ED08 05qalJGq9fFljHagQoBM6gIFC4qGSB X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mark Brown via Libc-alpha From: Mark Brown Reply-To: Mark Brown Cc: linux-arch@vger.kernel.org, Yu-cheng Yu , libc-alpha@sourceware.org, Szabolcs Nagy , Jeremy Linton , Mark Brown , Dave Martin , linux-arm-kernel@lists.infradead.org Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Since we have added an is_interp flag to arch_parse_elf_property() we can drop the has_interp flag from arch_elf_adjust_prot(), the only user was the arm64 code which no longer needs it and any future users will be able to use arch_parse_elf_properties() to determine if an interpreter is in use. Signed-off-by: Mark Brown --- arch/arm64/kernel/process.c | 2 +- fs/binfmt_elf.c | 2 +- include/linux/elf.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 21f1f0997c43..2b952593534a 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -751,7 +751,7 @@ static inline int arm64_elf_bti_flag(bool is_interp) int arch_elf_adjust_prot(int prot, const struct arch_elf_state *state, - bool has_interp, bool is_interp) + bool is_interp) { if ((prot & PROT_EXEC) && (state->flags & arm64_elf_bti_flag(is_interp))) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index c0d4f35c80f6..ffe38d54308b 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -580,7 +580,7 @@ static inline int make_prot(u32 p_flags, struct arch_elf_state *arch_state, if (p_flags & PF_X) prot |= PROT_EXEC; - return arch_elf_adjust_prot(prot, arch_state, has_interp, is_interp); + return arch_elf_adjust_prot(prot, arch_state, is_interp); } /* This is much more generalized than the library routine read function, diff --git a/include/linux/elf.h b/include/linux/elf.h index 1c45ecf29147..d8392531899d 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -101,11 +101,11 @@ extern int arch_parse_elf_property(u32 type, const void *data, size_t datasz, #ifdef CONFIG_ARCH_HAVE_ELF_PROT int arch_elf_adjust_prot(int prot, const struct arch_elf_state *state, - bool has_interp, bool is_interp); + bool is_interp); #else static inline int arch_elf_adjust_prot(int prot, const struct arch_elf_state *state, - bool has_interp, bool is_interp) + bool is_interp) { return prot; }