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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32605C433F5 for ; Fri, 4 Feb 2022 13:00:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242418AbiBDNAM (ORCPT ); Fri, 4 Feb 2022 08:00:12 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:49462 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240522AbiBDNAM (ORCPT ); Fri, 4 Feb 2022 08:00:12 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 2CFC5CE22C7 for ; Fri, 4 Feb 2022 13:00:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54A3DC340E9; Fri, 4 Feb 2022 13:00:07 +0000 (UTC) Date: Fri, 4 Feb 2022 13:00:04 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Szabolcs Nagy , Jeremy Linton , "H . J . Lu" , Yu-cheng Yu , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, libc-alpha@sourceware.org, Dave Martin Subject: Re: [PATCH v8 1/4] elf: Allow architectures to parse properties on the main executable Message-ID: References: <20220124150704.2559523-1-broonie@kernel.org> <20220124150704.2559523-2-broonie@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220124150704.2559523-2-broonie@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Mon, Jan 24, 2022 at 03:07:01PM +0000, Mark Brown wrote: > Currently the ELF code only attempts to parse properties on the image > that will start execution, either the interpreter or for statically linked > executables the main executable. The expectation is that any property > handling for the main executable will be done by the interpreter. This is > a bit inconsistent since we do map the executable and is causing problems > for the arm64 BTI support when used in conjunction with systemd's use of > seccomp to implement MemoryDenyWriteExecute which stops the dynamic linker > adjusting the permissions of executable segments. > > Allow architectures to handle properties for both the dynamic linker and > main executable, adjusting arch_parse_elf_properties() to have a new > flag is_interp flag as with arch_elf_adjust_prot() and calling it for > both the main executable and any intepreter. > > The user of this code, arm64, is adapted to ensure that there is no > functional change. > > Signed-off-by: Mark Brown > Tested-by: Jeremy Linton > Reviewed-by: Dave Martin Reviewed-by: Catalin Marinas 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 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 4BF56C433EF for ; Fri, 4 Feb 2022 13:02:09 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nK9JqAJZi0idzPq5elTuDQXtbenjSBn/RhOSLmPEcHI=; b=kbRMjsZGcdQ2QG gwxGqe0kxUYsZVVKwj4cMeKNORVdBfOj4d4V/47N4oYWRO5VDQnKlmzGlAu8dgHoLmvpP5tAcqAz5 rnw4C3o5M+X9D1cWeLwYApLy+82nDsBZd39HJRV8badFol/UTQUuhYiRwaIBCCKGhP89tewPnj8HI METsMbAwoTyciVBSX8/P48WiENpo+qTj50M/xUBE90JQwpbGLxBMR9yUSA7WmyXeR//qxVbuw7VYl meBrU7JzwNVeryP9lBskQuUNDlB6tgRxDZq0sFTDgNzVd3/CGifBwEvj0ljAF84HBV1j+nR/l+ssE tf8cquwy7rTetb7mzLcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFyCD-004Kn2-GL; Fri, 04 Feb 2022 13:00:13 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFyCA-004Kmc-NN for linux-arm-kernel@lists.infradead.org; Fri, 04 Feb 2022 13:00:12 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CF4F461B94; Fri, 4 Feb 2022 13:00:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54A3DC340E9; Fri, 4 Feb 2022 13:00:07 +0000 (UTC) Date: Fri, 4 Feb 2022 13:00:04 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Szabolcs Nagy , Jeremy Linton , "H . J . Lu" , Yu-cheng Yu , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, libc-alpha@sourceware.org, Dave Martin Subject: Re: [PATCH v8 1/4] elf: Allow architectures to parse properties on the main executable Message-ID: References: <20220124150704.2559523-1-broonie@kernel.org> <20220124150704.2559523-2-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220124150704.2559523-2-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220204_050010_828271_63D3ECAD X-CRM114-Status: GOOD ( 17.72 ) 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 On Mon, Jan 24, 2022 at 03:07:01PM +0000, Mark Brown wrote: > Currently the ELF code only attempts to parse properties on the image > that will start execution, either the interpreter or for statically linked > executables the main executable. The expectation is that any property > handling for the main executable will be done by the interpreter. This is > a bit inconsistent since we do map the executable and is causing problems > for the arm64 BTI support when used in conjunction with systemd's use of > seccomp to implement MemoryDenyWriteExecute which stops the dynamic linker > adjusting the permissions of executable segments. > > Allow architectures to handle properties for both the dynamic linker and > main executable, adjusting arch_parse_elf_properties() to have a new > flag is_interp flag as with arch_elf_adjust_prot() and calling it for > both the main executable and any intepreter. > > The user of this code, arm64, is adapted to ensure that there is no > functional change. > > Signed-off-by: Mark Brown > Tested-by: Jeremy Linton > Reviewed-by: Dave Martin Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel