aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-03-01 17:36:12 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-11-22 14:31:25 +0000
commit871fb8be0164201890e337b90159e8208abe2913 (patch)
tree14ec90efce5d209de889a8215a63717df3a3f88c /sysdeps/unix
parent0b888aef9a0f9ef17fcb62458101b550bce7a776 (diff)
downloadglibc-871fb8be0164201890e337b90159e8208abe2913.zip
glibc-871fb8be0164201890e337b90159e8208abe2913.tar.gz
glibc-871fb8be0164201890e337b90159e8208abe2913.tar.bz2
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.h5
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 49d8f97..c5d864f 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
}