From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78699C2B9F4 for ; Mon, 14 Jun 2021 22:33:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A55861356 for ; Mon, 14 Jun 2021 22:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229979AbhFNWfQ (ORCPT ); Mon, 14 Jun 2021 18:35:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:52180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbhFNWfP (ORCPT ); Mon, 14 Jun 2021 18:35:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 02B52611CE; Mon, 14 Jun 2021 22:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623709992; bh=fCxAxBsrdCysAQR8O0YHtW9cXxwUrKw65hU1mQ0qWk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MJA72SOIQ01jNlRC27EKVdasYKprLJOrD1tzu4aQ6r4GenG2ayV26NYRWeyKdkzKe DYHyYHRcXFQBZSNZ3bs18397h3Hy3pl9+Gt+3gYmxmGlRrwze+ou7PWEFrT9Qu2kLV QaMkl8lPvnsFxlizQtPtpuF9MnIVEp/Lp6GWNjnvND9x2ZmHmD74trzwRt4TMD9fb5 cHcosRyz8CIogWD/6CeGOyx6g33s77dCLMfHvc/B5DI+TgfgZZ7rrwkjj2bHVWUAik 2ZHsx7zZ9RyS60tBHW68HKOWxelcmMNHs/RdvNrWvlxUkPjVXCin7UDtcWds1wDV34 4utHSLiqHKukg== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Szabolcs Nagy , Jeremy Linton , Dave Martin , "H . J . Lu" , Yu-cheng Yu , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, libc-alpha@sourceware.org, Mark Brown 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org 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; } -- 2.20.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0636FC2B9F4 for ; Mon, 14 Jun 2021 22:35:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C9BF56124B for ; Mon, 14 Jun 2021 22:35:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9BF56124B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XdDL2IF71LGZOlYavAeq3FIJUG2ZXhLSKq/7OGZIYxU=; b=r2gDdTuq+OJebr 7Xt9NG1ojSH5N6bdufc/ttR1e4clKFiKbh51jrknZVvth+TtVFCM4VbEsUL4ZGmu6vlk4ctKH557M QXrIz5UUHj58hsC9SxLhvfgG2cSdkRCrHgs29beQX0ev6Z+1EXgLRvHsCCCx/JCpg0t7FkXZU4Sge Nq89cH2TKFw+HydZ8f7A+uDJ+w1YBgPjLYdLY+7OI399sPYCqhh4t2VITC5CvvAMi98TN+NOVKoS1 8EBKSsGls+VBQ8dhAfjZyeMqR6a89jdUaHHEUeY6eFIrlpMz3F5ipXMcQD70sqzN/1V8OX6gOfHrp ZyNjQsKUwz2GdJxpS9JA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsv9N-00GPoS-Ty; Mon, 14 Jun 2021 22:33:46 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsv8q-00GPfv-Qd for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 22:33:14 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 02B52611CE; Mon, 14 Jun 2021 22:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623709992; bh=fCxAxBsrdCysAQR8O0YHtW9cXxwUrKw65hU1mQ0qWk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MJA72SOIQ01jNlRC27EKVdasYKprLJOrD1tzu4aQ6r4GenG2ayV26NYRWeyKdkzKe DYHyYHRcXFQBZSNZ3bs18397h3Hy3pl9+Gt+3gYmxmGlRrwze+ou7PWEFrT9Qu2kLV QaMkl8lPvnsFxlizQtPtpuF9MnIVEp/Lp6GWNjnvND9x2ZmHmD74trzwRt4TMD9fb5 cHcosRyz8CIogWD/6CeGOyx6g33s77dCLMfHvc/B5DI+TgfgZZ7rrwkjj2bHVWUAik 2ZHsx7zZ9RyS60tBHW68HKOWxelcmMNHs/RdvNrWvlxUkPjVXCin7UDtcWds1wDV34 4utHSLiqHKukg== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Szabolcs Nagy , Jeremy Linton , Dave Martin , "H . J . Lu" , Yu-cheng Yu , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, libc-alpha@sourceware.org, Mark Brown 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_153312_931676_95CB94F0 X-CRM114-Status: GOOD ( 11.64 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; } -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel