From: Szabolcs Nagy Date: Fri, 29 Apr 2022 13:02:17 +0000 (+0100) Subject: aarch64: elf: avoid loading incompatible binaries X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73d195966deacbd30a7c62ad922b66dfba804ccc;p=thirdparty%2Fglibc.git aarch64: elf: avoid loading incompatible binaries Prevent lp64 ld.so loading purecap binaries. --- diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index ae8b14425a6..f31695aff1e 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. */