From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 389DD388302C; Wed, 26 Oct 2022 15:19:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 389DD388302C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666797574; bh=Eu5neX8l0bKDXhLK0nNSmqdpfiLNsLbpk4NixQYc6qE=; h=From:To:Subject:Date:From; b=ycpL/bPV1x0kOs5+dSxJXLbEVbAYlP/Hcy+Gj/vwyzenztMF6t8GpM45bHyY/CtH+ xi4EYH3OG5TIGAi+ePscYbHjcnytXG3BGBCMW9oSKpiholeSMeRZLH3apQCWEq56GF /lPRallvwEvTwyU6N2CgKAafs896mJ53Vk0IDqGg= 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: bb888e6901940bf2d1c72b756ad172b351731abd X-Git-Newrev: be17e8b5fb37550d3b6ce373d6c74b5409a0833c Message-Id: <20221026151934.389DD388302C@sourceware.org> Date: Wed, 26 Oct 2022 15:19:34 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=be17e8b5fb37550d3b6ce373d6c74b5409a0833c commit be17e8b5fb37550d3b6ce373d6c74b5409a0833c 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. */