From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 15D473852C56; Wed, 23 Nov 2022 14:44:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15D473852C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669214687; bh=r1xiUbtnfzsWGI7CmI9qjhZ6tRyo8dV4Ib3Tm0Zei50=; h=From:To:Subject:Date:From; b=jocMZCK6In5RsM7WueVd+ftAIFfDFrtExNQmf2xeMl19Ibi4S4fVFh40Pt3LGl0Cg 0+zNFpTzHnvlepP5Av60L4+oHef0I40GtMAyxV79PKd45jmekwvd619mQkiqNzRk0f mCt+OvQcmt4Xcftmhxu3nOQTnbkVFz+1p+hjY4J8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] cheri: don't use dl_random for pointer mangling X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: 0b888aef9a0f9ef17fcb62458101b550bce7a776 X-Git-Newrev: 871fb8be0164201890e337b90159e8208abe2913 Message-Id: <20221123144447.15D473852C56@sourceware.org> Date: Wed, 23 Nov 2022 14:44:47 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=871fb8be0164201890e337b90159e8208abe2913 commit 871fb8be0164201890e337b90159e8208abe2913 Author: Szabolcs Nagy Date: Tue Mar 1 17:36:12 2022 +0000 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. Diff: --- sysdeps/unix/sysv/linux/dl-osinfo.h | 5 +++++ 1 file changed, 5 insertions(+) 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 }