From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 6EF9A385AE47; Fri, 5 Aug 2022 19:36:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EF9A385AE47 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: rtld: avoid loading incompatible binaries X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: 392f32c841c9feefdc376129d2ac2215855decc4 X-Git-Newrev: 6f93421a5f177e382832cf49a5796eadabee32a9 Message-Id: <20220805193656.6EF9A385AE47@sourceware.org> Date: Fri, 5 Aug 2022 19:36:56 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2022 19:36:56 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6f93421a5f177e382832cf49a5796eadabee32a9 commit 6f93421a5f177e382832cf49a5796eadabee32a9 Author: Szabolcs Nagy Date: Fri Apr 29 14:02:17 2022 +0100 aarch64: rtld: 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. */