diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-03-01 17:36:12 +0000 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-10-27 14:46:51 +0100 |
commit | 8fc31e80652b073dfad49a57f925663db8d618eb (patch) | |
tree | 864e33a1723f6a40d3cedf704fd67ffda00428e1 /sysdeps/unix | |
parent | 1d7fa3f736b795e4e2b953ebc3bd89a8e55471f2 (diff) | |
download | glibc-8fc31e80652b073dfad49a57f925663db8d618eb.tar glibc-8fc31e80652b073dfad49a57f925663db8d618eb.tar.gz glibc-8fc31e80652b073dfad49a57f925663db8d618eb.tar.bz2 glibc-8fc31e80652b073dfad49a57f925663db8d618eb.zip |
cheri: don't use dl_random for pointer mangling
Pointer mangling cannot be supported on capability architectures.
And there is not enough bytes in dl_random for 128 bit pointers.
Stack guard is still loaded from dl_random: stack protection is
unlikely to be useful on a capability architecture, but it works.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/dl-osinfo.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h index 49d8f973c8..c5d864f5ba 100644 --- a/sysdeps/unix/sysv/linux/dl-osinfo.h +++ b/sysdeps/unix/sysv/linux/dl-osinfo.h @@ -52,7 +52,12 @@ _dl_setup_stack_chk_guard (void *dl_random) static inline uintptr_t __attribute__ ((always_inline)) _dl_setup_pointer_guard (void *dl_random, uintptr_t stack_chk_guard) { +#ifdef __CHERI_PURE_CAPABILITY__ + /* Pointer mangling is not supported on capability architectures. */ + return 0; +#else uintptr_t ret; memcpy (&ret, (char *) dl_random + sizeof (ret), sizeof (ret)); return ret; +#endif } |