public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] cheri: rseq: remove const to avoid readonly permission
@ 2022-11-23 14:46 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-11-23 14:46 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1b8d019265ebe0b6c27a8e845de3127449956dd6
commit 1b8d019265ebe0b6c27a8e845de3127449956dd6
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Tue Mar 1 09:44:14 2022 +0000
cheri: rseq: remove const to avoid readonly permission
Using const on the definition does not work for a pure capability ABI:
the capability permissions when accessing the object will be read only.
Use a hack to hide the public declaration in the TU where the const
objects are initialized. (This should work on non-capability targets
too, but to err on the safe side only enable the hack on capability
targets.)
Diff:
---
sysdeps/nptl/dl-tls_init_tp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c
index 53fba774a5..e4d7bb71ad 100644
--- a/sysdeps/nptl/dl-tls_init_tp.c
+++ b/sysdeps/nptl/dl-tls_init_tp.c
@@ -16,6 +16,15 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifdef __CHERI_PURE_CAPABILITY__
+/* This hack ensures that the later indirectly included public const
+ declaration does not conflict with the non-const definition here. */
+# define __rseq_size __rseq_size_public_const
+# define __rseq_offset __rseq_offset_public_const
+# include <sys/rseq.h>
+# undef __rseq_size
+# undef __rseq_offset
+#endif
#include <kernel-features.h>
#include <ldsodefs.h>
#include <list.h>
@@ -45,8 +54,13 @@ rtld_mutex_dummy (pthread_mutex_t *lock)
#endif
const unsigned int __rseq_flags;
+#ifdef __CHERI_PURE_CAPABILITY__
+unsigned int __rseq_size attribute_relro;
+ptrdiff_t __rseq_offset attribute_relro;
+#else
const unsigned int __rseq_size attribute_relro;
const ptrdiff_t __rseq_offset attribute_relro;
+#endif
void
__tls_pre_init_tp (void)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] cheri: rseq: remove const to avoid readonly permission
@ 2022-10-27 13:56 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-27 13:56 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1865211ef5d027f10033397b8c5d46052f069cec
commit 1865211ef5d027f10033397b8c5d46052f069cec
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Tue Mar 1 09:44:14 2022 +0000
cheri: rseq: remove const to avoid readonly permission
Using const on the definition does not work for a pure capability ABI:
the capability permissions when accessing the object will be read only.
Use a hack to hide the public declaration in the TU where the const
objects are initialized. (This should work on non-capability targets
too, but to err on the safe side only enable the hack on capability
targets.)
Diff:
---
sysdeps/nptl/dl-tls_init_tp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c
index 53fba774a5..e4d7bb71ad 100644
--- a/sysdeps/nptl/dl-tls_init_tp.c
+++ b/sysdeps/nptl/dl-tls_init_tp.c
@@ -16,6 +16,15 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifdef __CHERI_PURE_CAPABILITY__
+/* This hack ensures that the later indirectly included public const
+ declaration does not conflict with the non-const definition here. */
+# define __rseq_size __rseq_size_public_const
+# define __rseq_offset __rseq_offset_public_const
+# include <sys/rseq.h>
+# undef __rseq_size
+# undef __rseq_offset
+#endif
#include <kernel-features.h>
#include <ldsodefs.h>
#include <list.h>
@@ -45,8 +54,13 @@ rtld_mutex_dummy (pthread_mutex_t *lock)
#endif
const unsigned int __rseq_flags;
+#ifdef __CHERI_PURE_CAPABILITY__
+unsigned int __rseq_size attribute_relro;
+ptrdiff_t __rseq_offset attribute_relro;
+#else
const unsigned int __rseq_size attribute_relro;
const ptrdiff_t __rseq_offset attribute_relro;
+#endif
void
__tls_pre_init_tp (void)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] cheri: rseq: remove const to avoid readonly permission
@ 2022-10-26 15:17 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:17 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f7805973566d87ac2224ba8c0b8a3b385e9ad0f5
commit f7805973566d87ac2224ba8c0b8a3b385e9ad0f5
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Tue Mar 1 09:44:14 2022 +0000
cheri: rseq: remove const to avoid readonly permission
Using const on the definition does not work for a pure capability ABI:
the capability permissions when accessing the object will be read only.
Use a hack to hide the public declaration in the TU where the const
objects are initialized. (This should work on non-capability targets
too, but to err on the safe side only enable the hack on capability
targets.)
Diff:
---
sysdeps/nptl/dl-tls_init_tp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c
index 53fba774a5..e4d7bb71ad 100644
--- a/sysdeps/nptl/dl-tls_init_tp.c
+++ b/sysdeps/nptl/dl-tls_init_tp.c
@@ -16,6 +16,15 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifdef __CHERI_PURE_CAPABILITY__
+/* This hack ensures that the later indirectly included public const
+ declaration does not conflict with the non-const definition here. */
+# define __rseq_size __rseq_size_public_const
+# define __rseq_offset __rseq_offset_public_const
+# include <sys/rseq.h>
+# undef __rseq_size
+# undef __rseq_offset
+#endif
#include <kernel-features.h>
#include <ldsodefs.h>
#include <list.h>
@@ -45,8 +54,13 @@ rtld_mutex_dummy (pthread_mutex_t *lock)
#endif
const unsigned int __rseq_flags;
+#ifdef __CHERI_PURE_CAPABILITY__
+unsigned int __rseq_size attribute_relro;
+ptrdiff_t __rseq_offset attribute_relro;
+#else
const unsigned int __rseq_size attribute_relro;
const ptrdiff_t __rseq_offset attribute_relro;
+#endif
void
__tls_pre_init_tp (void)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] cheri: rseq: remove const to avoid readonly permission
@ 2022-08-05 19:35 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-08-05 19:35 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5778537ccd9a2cf46e3f4c323f84118d5a514739
commit 5778537ccd9a2cf46e3f4c323f84118d5a514739
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Tue Mar 1 09:44:14 2022 +0000
cheri: rseq: remove const to avoid readonly permission
Using const on the definition does not work for a pure capability ABI:
the capability permissions when accessing the object will be read only.
Use a hack to hide the public declaration in the TU where the const
objects are initialized. (This should work on non-capability targets
too, but to err on the safe side only enable the hack on capability
targets.)
Diff:
---
sysdeps/nptl/dl-tls_init_tp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c
index 53fba774a5..e4d7bb71ad 100644
--- a/sysdeps/nptl/dl-tls_init_tp.c
+++ b/sysdeps/nptl/dl-tls_init_tp.c
@@ -16,6 +16,15 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifdef __CHERI_PURE_CAPABILITY__
+/* This hack ensures that the later indirectly included public const
+ declaration does not conflict with the non-const definition here. */
+# define __rseq_size __rseq_size_public_const
+# define __rseq_offset __rseq_offset_public_const
+# include <sys/rseq.h>
+# undef __rseq_size
+# undef __rseq_offset
+#endif
#include <kernel-features.h>
#include <ldsodefs.h>
#include <list.h>
@@ -45,8 +54,13 @@ rtld_mutex_dummy (pthread_mutex_t *lock)
#endif
const unsigned int __rseq_flags;
+#ifdef __CHERI_PURE_CAPABILITY__
+unsigned int __rseq_size attribute_relro;
+ptrdiff_t __rseq_offset attribute_relro;
+#else
const unsigned int __rseq_size attribute_relro;
const ptrdiff_t __rseq_offset attribute_relro;
+#endif
void
__tls_pre_init_tp (void)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-23 14:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 14:46 [glibc/arm/morello/main] cheri: rseq: remove const to avoid readonly permission Szabolcs Nagy
-- strict thread matches above, loose matches on Subject: below --
2022-10-27 13:56 Szabolcs Nagy
2022-10-26 15:17 Szabolcs Nagy
2022-08-05 19:35 Szabolcs Nagy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).