public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities
@ 2022-10-26 15:21 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:21 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ad8c13ecf9d0146529d868aeae82e90b7a1d34d3
commit ad8c13ecf9d0146529d868aeae82e90b7a1d34d3
Author: Carlos Eduardo Seo <carlos.seo@arm.com>
Date: Wed May 18 00:52:09 2022 +0000
TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities
New function to return values from the auxiliary vector as
capabilities. This is the same as implemented by other C libraries.
TODO: agree about exact semantics across libcs
Diff:
---
include/sys/auxv.h | 4 ++++
misc/Versions | 3 +++
misc/getauxval.c | 33 +++++++++++++++++++++++++++++++++
misc/sys/auxv.h | 4 ++++
4 files changed, 44 insertions(+)
diff --git a/include/sys/auxv.h b/include/sys/auxv.h
index dd0602b08d..0bd40bd835 100644
--- a/include/sys/auxv.h
+++ b/include/sys/auxv.h
@@ -10,4 +10,8 @@ libc_hidden_proto (__getauxval)
_Bool __getauxval2 (unsigned long int type, unsigned long int *result);
libc_hidden_proto (__getauxval2)
+/* Like getauxval, but for Arm Morello capabilities. */
+extern __typeof (getauxptr) __getauxptr;
+libc_hidden_proto (__getauxptr)
+
#endif /* !_ISOMAC */
diff --git a/misc/Versions b/misc/Versions
index d5b348e83a..669a03ffb3 100644
--- a/misc/Versions
+++ b/misc/Versions
@@ -164,6 +164,9 @@ libc {
GLIBC_2.32 {
__libc_single_threaded;
}
+ GLIBC_2.36 {
+ __getauxptr; getauxptr;
+ }
GLIBC_PRIVATE {
__madvise;
__mktemp;
diff --git a/misc/getauxval.c b/misc/getauxval.c
index 714ce5bd62..a4625b8596 100644
--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -20,6 +20,39 @@
#include <ldsodefs.h>
#include <stdbool.h>
+void *
+__getauxptr (unsigned long int type)
+{
+ /* error if asking for a non-pointer from getauxptr(). This list is not a
+ perfect enforcement as it currently supports both transitional and draft
+ ABIs, which have different capability entries. */
+ switch (type) {
+ case AT_ENTRY:
+ case AT_PHDR:
+ case AT_BASE:
+ case AT_SYSINFO_EHDR:
+ case AT_EXECFN:
+ case AT_RANDOM:
+ case AT_PLATFORM:
+ case AT_CHERI_EXEC_RW_CAP:
+ case AT_CHERI_EXEC_RX_CAP:
+ case AT_CHERI_INTERP_RW_CAP:
+ case AT_CHERI_INTERP_RX_CAP:
+ case AT_CHERI_SEAL_CAP:
+ {
+ ElfW(auxv_t) *p;
+ for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
+ if (p->a_type == type)
+ return (void *) p->a_un.a_val;
+ }
+ }
+
+ __set_errno (ENOENT);
+ return 0;
+}
+weak_alias (__getauxptr, getauxptr)
+libc_hidden_def (__getauxptr)
+
bool
__getauxval2 (unsigned long int type, unsigned long int *result)
{
diff --git a/misc/sys/auxv.h b/misc/sys/auxv.h
index b5ab30ab77..8446aeddd0 100644
--- a/misc/sys/auxv.h
+++ b/misc/sys/auxv.h
@@ -31,6 +31,10 @@ __BEGIN_DECLS
extern unsigned long int getauxval (unsigned long int __type)
__THROW;
+/* Same as getauxval, but for Arm Morello capabilities. */
+extern void * getauxptr (unsigned long int __type)
+ __THROW;
+
__END_DECLS
#endif /* sys/auxv.h */
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities
@ 2022-11-23 14:49 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-11-23 14:49 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f1d4e428354a0b9b04b47508af8592ff9caa516b
commit f1d4e428354a0b9b04b47508af8592ff9caa516b
Author: Carlos Eduardo Seo <carlos.seo@arm.com>
Date: Wed May 18 00:52:09 2022 +0000
TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities
New function to return values from the auxiliary vector as
capabilities. This is the same as implemented by other C libraries.
TODO: agree about exact semantics across libcs
Diff:
---
include/sys/auxv.h | 4 ++++
misc/Versions | 3 +++
misc/getauxval.c | 33 +++++++++++++++++++++++++++++++++
misc/sys/auxv.h | 4 ++++
4 files changed, 44 insertions(+)
diff --git a/include/sys/auxv.h b/include/sys/auxv.h
index dd0602b08d..0bd40bd835 100644
--- a/include/sys/auxv.h
+++ b/include/sys/auxv.h
@@ -10,4 +10,8 @@ libc_hidden_proto (__getauxval)
_Bool __getauxval2 (unsigned long int type, unsigned long int *result);
libc_hidden_proto (__getauxval2)
+/* Like getauxval, but for Arm Morello capabilities. */
+extern __typeof (getauxptr) __getauxptr;
+libc_hidden_proto (__getauxptr)
+
#endif /* !_ISOMAC */
diff --git a/misc/Versions b/misc/Versions
index d5b348e83a..669a03ffb3 100644
--- a/misc/Versions
+++ b/misc/Versions
@@ -164,6 +164,9 @@ libc {
GLIBC_2.32 {
__libc_single_threaded;
}
+ GLIBC_2.36 {
+ __getauxptr; getauxptr;
+ }
GLIBC_PRIVATE {
__madvise;
__mktemp;
diff --git a/misc/getauxval.c b/misc/getauxval.c
index 714ce5bd62..a4625b8596 100644
--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -20,6 +20,39 @@
#include <ldsodefs.h>
#include <stdbool.h>
+void *
+__getauxptr (unsigned long int type)
+{
+ /* error if asking for a non-pointer from getauxptr(). This list is not a
+ perfect enforcement as it currently supports both transitional and draft
+ ABIs, which have different capability entries. */
+ switch (type) {
+ case AT_ENTRY:
+ case AT_PHDR:
+ case AT_BASE:
+ case AT_SYSINFO_EHDR:
+ case AT_EXECFN:
+ case AT_RANDOM:
+ case AT_PLATFORM:
+ case AT_CHERI_EXEC_RW_CAP:
+ case AT_CHERI_EXEC_RX_CAP:
+ case AT_CHERI_INTERP_RW_CAP:
+ case AT_CHERI_INTERP_RX_CAP:
+ case AT_CHERI_SEAL_CAP:
+ {
+ ElfW(auxv_t) *p;
+ for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
+ if (p->a_type == type)
+ return (void *) p->a_un.a_val;
+ }
+ }
+
+ __set_errno (ENOENT);
+ return 0;
+}
+weak_alias (__getauxptr, getauxptr)
+libc_hidden_def (__getauxptr)
+
bool
__getauxval2 (unsigned long int type, unsigned long int *result)
{
diff --git a/misc/sys/auxv.h b/misc/sys/auxv.h
index b5ab30ab77..8446aeddd0 100644
--- a/misc/sys/auxv.h
+++ b/misc/sys/auxv.h
@@ -31,6 +31,10 @@ __BEGIN_DECLS
extern unsigned long int getauxval (unsigned long int __type)
__THROW;
+/* Same as getauxval, but for Arm Morello capabilities. */
+extern void * getauxptr (unsigned long int __type)
+ __THROW;
+
__END_DECLS
#endif /* sys/auxv.h */
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities
@ 2022-10-27 14:00 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-27 14:00 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3386ca6696dbf1578fe605f9b380931052bd7329
commit 3386ca6696dbf1578fe605f9b380931052bd7329
Author: Carlos Eduardo Seo <carlos.seo@arm.com>
Date: Wed May 18 00:52:09 2022 +0000
TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities
New function to return values from the auxiliary vector as
capabilities. This is the same as implemented by other C libraries.
TODO: agree about exact semantics across libcs
Diff:
---
include/sys/auxv.h | 4 ++++
misc/Versions | 3 +++
misc/getauxval.c | 33 +++++++++++++++++++++++++++++++++
misc/sys/auxv.h | 4 ++++
4 files changed, 44 insertions(+)
diff --git a/include/sys/auxv.h b/include/sys/auxv.h
index dd0602b08d..0bd40bd835 100644
--- a/include/sys/auxv.h
+++ b/include/sys/auxv.h
@@ -10,4 +10,8 @@ libc_hidden_proto (__getauxval)
_Bool __getauxval2 (unsigned long int type, unsigned long int *result);
libc_hidden_proto (__getauxval2)
+/* Like getauxval, but for Arm Morello capabilities. */
+extern __typeof (getauxptr) __getauxptr;
+libc_hidden_proto (__getauxptr)
+
#endif /* !_ISOMAC */
diff --git a/misc/Versions b/misc/Versions
index d5b348e83a..669a03ffb3 100644
--- a/misc/Versions
+++ b/misc/Versions
@@ -164,6 +164,9 @@ libc {
GLIBC_2.32 {
__libc_single_threaded;
}
+ GLIBC_2.36 {
+ __getauxptr; getauxptr;
+ }
GLIBC_PRIVATE {
__madvise;
__mktemp;
diff --git a/misc/getauxval.c b/misc/getauxval.c
index 714ce5bd62..a4625b8596 100644
--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -20,6 +20,39 @@
#include <ldsodefs.h>
#include <stdbool.h>
+void *
+__getauxptr (unsigned long int type)
+{
+ /* error if asking for a non-pointer from getauxptr(). This list is not a
+ perfect enforcement as it currently supports both transitional and draft
+ ABIs, which have different capability entries. */
+ switch (type) {
+ case AT_ENTRY:
+ case AT_PHDR:
+ case AT_BASE:
+ case AT_SYSINFO_EHDR:
+ case AT_EXECFN:
+ case AT_RANDOM:
+ case AT_PLATFORM:
+ case AT_CHERI_EXEC_RW_CAP:
+ case AT_CHERI_EXEC_RX_CAP:
+ case AT_CHERI_INTERP_RW_CAP:
+ case AT_CHERI_INTERP_RX_CAP:
+ case AT_CHERI_SEAL_CAP:
+ {
+ ElfW(auxv_t) *p;
+ for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
+ if (p->a_type == type)
+ return (void *) p->a_un.a_val;
+ }
+ }
+
+ __set_errno (ENOENT);
+ return 0;
+}
+weak_alias (__getauxptr, getauxptr)
+libc_hidden_def (__getauxptr)
+
bool
__getauxval2 (unsigned long int type, unsigned long int *result)
{
diff --git a/misc/sys/auxv.h b/misc/sys/auxv.h
index b5ab30ab77..8446aeddd0 100644
--- a/misc/sys/auxv.h
+++ b/misc/sys/auxv.h
@@ -31,6 +31,10 @@ __BEGIN_DECLS
extern unsigned long int getauxval (unsigned long int __type)
__THROW;
+/* Same as getauxval, but for Arm Morello capabilities. */
+extern void * getauxptr (unsigned long int __type)
+ __THROW;
+
__END_DECLS
#endif /* sys/auxv.h */
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities
@ 2022-08-05 19:37 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-08-05 19:37 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b9e393156be659736cec34d1b12b92cc47ebe3a
commit 2b9e393156be659736cec34d1b12b92cc47ebe3a
Author: Carlos Eduardo Seo <carlos.seo@arm.com>
Date: Wed May 18 00:52:09 2022 +0000
TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities
New function to return values from the auxiliary vector as
capabilities. This is the same as implemented by other C libraries.
TODO: agree about exact semantics across libcs
Diff:
---
include/sys/auxv.h | 4 ++++
misc/Versions | 3 +++
misc/getauxval.c | 33 +++++++++++++++++++++++++++++++++
misc/sys/auxv.h | 4 ++++
4 files changed, 44 insertions(+)
diff --git a/include/sys/auxv.h b/include/sys/auxv.h
index dd0602b08d..0bd40bd835 100644
--- a/include/sys/auxv.h
+++ b/include/sys/auxv.h
@@ -10,4 +10,8 @@ libc_hidden_proto (__getauxval)
_Bool __getauxval2 (unsigned long int type, unsigned long int *result);
libc_hidden_proto (__getauxval2)
+/* Like getauxval, but for Arm Morello capabilities. */
+extern __typeof (getauxptr) __getauxptr;
+libc_hidden_proto (__getauxptr)
+
#endif /* !_ISOMAC */
diff --git a/misc/Versions b/misc/Versions
index d5b348e83a..669a03ffb3 100644
--- a/misc/Versions
+++ b/misc/Versions
@@ -164,6 +164,9 @@ libc {
GLIBC_2.32 {
__libc_single_threaded;
}
+ GLIBC_2.36 {
+ __getauxptr; getauxptr;
+ }
GLIBC_PRIVATE {
__madvise;
__mktemp;
diff --git a/misc/getauxval.c b/misc/getauxval.c
index 714ce5bd62..a4625b8596 100644
--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -20,6 +20,39 @@
#include <ldsodefs.h>
#include <stdbool.h>
+void *
+__getauxptr (unsigned long int type)
+{
+ /* error if asking for a non-pointer from getauxptr(). This list is not a
+ perfect enforcement as it currently supports both transitional and draft
+ ABIs, which have different capability entries. */
+ switch (type) {
+ case AT_ENTRY:
+ case AT_PHDR:
+ case AT_BASE:
+ case AT_SYSINFO_EHDR:
+ case AT_EXECFN:
+ case AT_RANDOM:
+ case AT_PLATFORM:
+ case AT_CHERI_EXEC_RW_CAP:
+ case AT_CHERI_EXEC_RX_CAP:
+ case AT_CHERI_INTERP_RW_CAP:
+ case AT_CHERI_INTERP_RX_CAP:
+ case AT_CHERI_SEAL_CAP:
+ {
+ ElfW(auxv_t) *p;
+ for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
+ if (p->a_type == type)
+ return (void *) p->a_un.a_val;
+ }
+ }
+
+ __set_errno (ENOENT);
+ return 0;
+}
+weak_alias (__getauxptr, getauxptr)
+libc_hidden_def (__getauxptr)
+
bool
__getauxval2 (unsigned long int type, unsigned long int *result)
{
diff --git a/misc/sys/auxv.h b/misc/sys/auxv.h
index b5ab30ab77..8446aeddd0 100644
--- a/misc/sys/auxv.h
+++ b/misc/sys/auxv.h
@@ -31,6 +31,10 @@ __BEGIN_DECLS
extern unsigned long int getauxval (unsigned long int __type)
__THROW;
+/* Same as getauxval, but for Arm Morello capabilities. */
+extern void * getauxptr (unsigned long int __type)
+ __THROW;
+
__END_DECLS
#endif /* sys/auxv.h */
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-23 14:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 15:21 [glibc/arm/morello/main] TODO(api): cheri: misc: Implement new function getauxptr for CHERI capabilities Szabolcs Nagy
-- strict thread matches above, loose matches on Subject: below --
2022-11-23 14:49 Szabolcs Nagy
2022-10-27 14:00 Szabolcs Nagy
2022-08-05 19:37 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).