public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] aarch64: rtld: avoid loading incompatible binaries
@ 2022-08-05 19:36 Szabolcs Nagy
  0 siblings, 0 replies; only message in thread
From: Szabolcs Nagy @ 2022-08-05 19:36 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6f93421a5f177e382832cf49a5796eadabee32a9

commit 6f93421a5f177e382832cf49a5796eadabee32a9
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
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.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-05 19:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 19:36 [glibc/arm/morello/main] aarch64: rtld: avoid loading incompatible binaries Szabolcs Nagy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).