From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id EC38C3851523; Thu, 27 Oct 2022 13:58:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC38C3851523 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666879087; bh=kpHlCL4ViixRJBYVK4xmI1D854Dp5/VErLXEtUyH4MY=; h=From:To:Subject:Date:From; b=ruJF+eG6TJsIkD9hxY9WH2jwstVMcOLIFp7AbGv/4ml0c3SpECiG/K3DU+tdZcCIg AefkS2BlyKDouXVBIig/5q0jlnu19roy0feq5jPINVipoyNR3dw2A2ZU/dCltD99bi 8p3PRHc1ja/Yp3KUS5/cMe0/mYU1+g535G8ZkDUI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] aarch64: elf: avoid loading incompatible binaries X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: eca0182a2b8f3603434f1385fadbb56cbfc90aab X-Git-Newrev: 73d195966deacbd30a7c62ad922b66dfba804ccc Message-Id: <20221027135807.EC38C3851523@sourceware.org> Date: Thu, 27 Oct 2022 13:58:07 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=73d195966deacbd30a7c62ad922b66dfba804ccc commit 73d195966deacbd30a7c62ad922b66dfba804ccc Author: Szabolcs Nagy Date: Fri Apr 29 14:02:17 2022 +0100 aarch64: elf: avoid loading incompatible binaries Prevent lp64 ld.so loading purecap binaries. Diff: --- sysdeps/aarch64/dl-machine.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index ae8b14425a..f31695aff1 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -36,7 +36,8 @@ static inline int __attribute__ ((unused)) elf_machine_matches_host (const ElfW(Ehdr) *ehdr) { - return ehdr->e_machine == EM_AARCH64; + return ehdr->e_machine == EM_AARCH64 + && (ehdr->e_flags & EF_AARCH64_CHERI_PURECAP) == 0; } /* Return the run-time load address of the shared object. */