aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-04-29 14:02:17 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-08-05 19:45:19 +0100
commit6f93421a5f177e382832cf49a5796eadabee32a9 (patch)
tree3f188c45da938683cca817c90c08c8aef419c808
parent392f32c841c9feefdc376129d2ac2215855decc4 (diff)
downloadglibc-6f93421a5f177e382832cf49a5796eadabee32a9.tar
glibc-6f93421a5f177e382832cf49a5796eadabee32a9.tar.gz
glibc-6f93421a5f177e382832cf49a5796eadabee32a9.tar.bz2
glibc-6f93421a5f177e382832cf49a5796eadabee32a9.zip
aarch64: rtld: avoid loading incompatible binaries
Prevent lp64 ld.so loading purecap binaries.
-rw-r--r--sysdeps/aarch64/dl-machine.h3
1 files changed, 2 insertions, 1 deletions
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. */