From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 5F67E3852C67; Wed, 23 Nov 2022 14:47:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F67E3852C67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669214875; bh=nPy7KmRL0lf69d4WeptuSI5oVIJWD3im0cJF+EXs7/c=; h=From:To:Subject:Date:From; b=mFvYM9/jZ0wYARaVnNxhOlJCoOyoYtDuyPatS9BaSpj+M7/yJSx7mbUDRZoI4PLkd QW4Cy+x/Vm+MSWbprsyXi96DhZ17VNrHkPkCbrmZpJ3WzKzB1riB9kjD1L+kW7I3uq vnl/7MfbGLKD0Ex+lexalrgy+8h5/xnmT3opspVs= 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: e252e5f0827ecbe82058c9c602f2dc5671072cdc X-Git-Newrev: c14096c2d31897465acf062bfe8ce2ebc510b866 Message-Id: <20221123144755.5F67E3852C67@sourceware.org> Date: Wed, 23 Nov 2022 14:47:55 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c14096c2d31897465acf062bfe8ce2ebc510b866 commit c14096c2d31897465acf062bfe8ce2ebc510b866 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. */