From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by sourceware.org (Postfix) with ESMTPS id EBD683858D20 for ; Fri, 4 Feb 2022 13:00:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EBD683858D20 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220124150704.2559523-2-broonie@kernel.org> X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Fri, 04 Feb 2022 13:00:13 -0000 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