public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] TODO(uapi): cheri: fix clone_args
@ 2022-08-05 19:32 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-08-05 19:32 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fb41a562bf4acfed5c7dc6c0c9b6c2f365d6731a

commit fb41a562bf4acfed5c7dc6c0c9b6c2f365d6731a
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Aug 2 11:34:56 2021 +0100

    TODO(uapi): cheri: fix clone_args
    
    Current clone_args does not support 128 bit pointers.
    
    TODO: the fix is incomplete (missing clone3 abi checks) and has to be
    aligned with purecap clone3 struct layout.

Diff:
---
 sysdeps/unix/sysv/linux/clone-internal.c |  2 ++
 sysdeps/unix/sysv/linux/clone3.h         | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
index a71effcbd3..8550fe9b24 100644
--- a/sysdeps/unix/sysv/linux/clone-internal.c
+++ b/sysdeps/unix/sysv/linux/clone-internal.c
@@ -32,6 +32,7 @@
 #define offsetofend(TYPE, MEMBER) \
   (offsetof (TYPE, MEMBER) + sizeof_field (TYPE, MEMBER))
 
+#ifndef __CHERI_PURE_CAPABILITY__
 _Static_assert (__alignof (struct clone_args) == 8,
 		"__alignof (struct clone_args) != 8");
 _Static_assert (offsetofend (struct clone_args, tls) == CLONE_ARGS_SIZE_VER0,
@@ -42,6 +43,7 @@ _Static_assert (offsetofend (struct clone_args, cgroup) == CLONE_ARGS_SIZE_VER2,
 		"offsetofend (struct clone_args, cgroup) != CLONE_ARGS_SIZE_VER2");
 _Static_assert (sizeof (struct clone_args) == CLONE_ARGS_SIZE_VER2,
 		"sizeof (struct clone_args) != CLONE_ARGS_SIZE_VER2");
+#endif
 
 int
 __clone_internal (struct clone_args *cl_args,
diff --git a/sysdeps/unix/sysv/linux/clone3.h b/sysdeps/unix/sysv/linux/clone3.h
index 889014a6a9..a3fc8deb29 100644
--- a/sysdeps/unix/sysv/linux/clone3.h
+++ b/sysdeps/unix/sysv/linux/clone3.h
@@ -34,6 +34,30 @@ typedef __U64_TYPE __aligned_uint64_t __attribute__ ((__aligned__ (8)));
 
 struct clone_args
 {
+#ifdef __CHERI_PURE_CAPABILITY__
+  /* Flags bit mask.  */
+  __uint64_t flags;
+  /* Where to store PID file descriptor (pid_t *).  */
+  __uintcap_t pidfd;
+  /* Where to store child TID, in child's memory (pid_t *).  */
+  __uintcap_t child_tid;
+  /* Where to store child TID, in parent's memory (int *). */
+  __uintcap_t parent_tid;
+  /* Signal to deliver to parent on child termination */
+  __uint64_t exit_signal;
+  /* The lowest address of stack.  */
+  __uintcap_t stack;
+  /* Size of stack.  */
+  __uint64_t stack_size;
+  /* Location of new TLS.  */
+  __uintcap_t tls;
+  /* Pointer to a pid_t array (since Linux 5.5).  */
+  __uintcap_t set_tid;
+  /* Number of elements in set_tid (since Linux 5.5). */
+  __uint64_t set_tid_size;
+  /* File descriptor for target cgroup of child (since Linux 5.7).  */
+  __uint64_t cgroup;
+#else
   /* Flags bit mask.  */
   __aligned_uint64_t flags;
   /* Where to store PID file descriptor (pid_t *).  */
@@ -56,6 +80,7 @@ struct clone_args
   __aligned_uint64_t set_tid_size;
   /* File descriptor for target cgroup of child (since Linux 5.7).  */
   __aligned_uint64_t cgroup;
+#endif
 };
 
 /* The wrapper of clone3.  */


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] TODO(uapi): cheri: fix clone_args
@ 2022-11-23 14:43 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-11-23 14:43 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b811a41c571a6a3c640d4d42177652a3034aee7b

commit b811a41c571a6a3c640d4d42177652a3034aee7b
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Aug 2 11:34:56 2021 +0100

    TODO(uapi): cheri: fix clone_args
    
    Current clone_args does not support 128 bit pointers.
    
    TODO: the fix is incomplete (missing clone3 abi checks) and has to be
    aligned with purecap clone3 struct layout.

Diff:
---
 sysdeps/unix/sysv/linux/clone-internal.c |  2 ++
 sysdeps/unix/sysv/linux/clone3.h         | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
index a71effcbd3..8550fe9b24 100644
--- a/sysdeps/unix/sysv/linux/clone-internal.c
+++ b/sysdeps/unix/sysv/linux/clone-internal.c
@@ -32,6 +32,7 @@
 #define offsetofend(TYPE, MEMBER) \
   (offsetof (TYPE, MEMBER) + sizeof_field (TYPE, MEMBER))
 
+#ifndef __CHERI_PURE_CAPABILITY__
 _Static_assert (__alignof (struct clone_args) == 8,
 		"__alignof (struct clone_args) != 8");
 _Static_assert (offsetofend (struct clone_args, tls) == CLONE_ARGS_SIZE_VER0,
@@ -42,6 +43,7 @@ _Static_assert (offsetofend (struct clone_args, cgroup) == CLONE_ARGS_SIZE_VER2,
 		"offsetofend (struct clone_args, cgroup) != CLONE_ARGS_SIZE_VER2");
 _Static_assert (sizeof (struct clone_args) == CLONE_ARGS_SIZE_VER2,
 		"sizeof (struct clone_args) != CLONE_ARGS_SIZE_VER2");
+#endif
 
 int
 __clone_internal (struct clone_args *cl_args,
diff --git a/sysdeps/unix/sysv/linux/clone3.h b/sysdeps/unix/sysv/linux/clone3.h
index 889014a6a9..a3fc8deb29 100644
--- a/sysdeps/unix/sysv/linux/clone3.h
+++ b/sysdeps/unix/sysv/linux/clone3.h
@@ -34,6 +34,30 @@ typedef __U64_TYPE __aligned_uint64_t __attribute__ ((__aligned__ (8)));
 
 struct clone_args
 {
+#ifdef __CHERI_PURE_CAPABILITY__
+  /* Flags bit mask.  */
+  __uint64_t flags;
+  /* Where to store PID file descriptor (pid_t *).  */
+  __uintcap_t pidfd;
+  /* Where to store child TID, in child's memory (pid_t *).  */
+  __uintcap_t child_tid;
+  /* Where to store child TID, in parent's memory (int *). */
+  __uintcap_t parent_tid;
+  /* Signal to deliver to parent on child termination */
+  __uint64_t exit_signal;
+  /* The lowest address of stack.  */
+  __uintcap_t stack;
+  /* Size of stack.  */
+  __uint64_t stack_size;
+  /* Location of new TLS.  */
+  __uintcap_t tls;
+  /* Pointer to a pid_t array (since Linux 5.5).  */
+  __uintcap_t set_tid;
+  /* Number of elements in set_tid (since Linux 5.5). */
+  __uint64_t set_tid_size;
+  /* File descriptor for target cgroup of child (since Linux 5.7).  */
+  __uint64_t cgroup;
+#else
   /* Flags bit mask.  */
   __aligned_uint64_t flags;
   /* Where to store PID file descriptor (pid_t *).  */
@@ -56,6 +80,7 @@ struct clone_args
   __aligned_uint64_t set_tid_size;
   /* File descriptor for target cgroup of child (since Linux 5.7).  */
   __aligned_uint64_t cgroup;
+#endif
 };
 
 /* The wrapper of clone3.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] TODO(uapi): cheri: fix clone_args
@ 2022-10-27 13:53 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-27 13:53 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c59bf19563fae0c9c3c741e104ab2162e39a175e

commit c59bf19563fae0c9c3c741e104ab2162e39a175e
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Aug 2 11:34:56 2021 +0100

    TODO(uapi): cheri: fix clone_args
    
    Current clone_args does not support 128 bit pointers.
    
    TODO: the fix is incomplete (missing clone3 abi checks) and has to be
    aligned with purecap clone3 struct layout.

Diff:
---
 sysdeps/unix/sysv/linux/clone-internal.c |  2 ++
 sysdeps/unix/sysv/linux/clone3.h         | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
index a71effcbd3..8550fe9b24 100644
--- a/sysdeps/unix/sysv/linux/clone-internal.c
+++ b/sysdeps/unix/sysv/linux/clone-internal.c
@@ -32,6 +32,7 @@
 #define offsetofend(TYPE, MEMBER) \
   (offsetof (TYPE, MEMBER) + sizeof_field (TYPE, MEMBER))
 
+#ifndef __CHERI_PURE_CAPABILITY__
 _Static_assert (__alignof (struct clone_args) == 8,
 		"__alignof (struct clone_args) != 8");
 _Static_assert (offsetofend (struct clone_args, tls) == CLONE_ARGS_SIZE_VER0,
@@ -42,6 +43,7 @@ _Static_assert (offsetofend (struct clone_args, cgroup) == CLONE_ARGS_SIZE_VER2,
 		"offsetofend (struct clone_args, cgroup) != CLONE_ARGS_SIZE_VER2");
 _Static_assert (sizeof (struct clone_args) == CLONE_ARGS_SIZE_VER2,
 		"sizeof (struct clone_args) != CLONE_ARGS_SIZE_VER2");
+#endif
 
 int
 __clone_internal (struct clone_args *cl_args,
diff --git a/sysdeps/unix/sysv/linux/clone3.h b/sysdeps/unix/sysv/linux/clone3.h
index 889014a6a9..a3fc8deb29 100644
--- a/sysdeps/unix/sysv/linux/clone3.h
+++ b/sysdeps/unix/sysv/linux/clone3.h
@@ -34,6 +34,30 @@ typedef __U64_TYPE __aligned_uint64_t __attribute__ ((__aligned__ (8)));
 
 struct clone_args
 {
+#ifdef __CHERI_PURE_CAPABILITY__
+  /* Flags bit mask.  */
+  __uint64_t flags;
+  /* Where to store PID file descriptor (pid_t *).  */
+  __uintcap_t pidfd;
+  /* Where to store child TID, in child's memory (pid_t *).  */
+  __uintcap_t child_tid;
+  /* Where to store child TID, in parent's memory (int *). */
+  __uintcap_t parent_tid;
+  /* Signal to deliver to parent on child termination */
+  __uint64_t exit_signal;
+  /* The lowest address of stack.  */
+  __uintcap_t stack;
+  /* Size of stack.  */
+  __uint64_t stack_size;
+  /* Location of new TLS.  */
+  __uintcap_t tls;
+  /* Pointer to a pid_t array (since Linux 5.5).  */
+  __uintcap_t set_tid;
+  /* Number of elements in set_tid (since Linux 5.5). */
+  __uint64_t set_tid_size;
+  /* File descriptor for target cgroup of child (since Linux 5.7).  */
+  __uint64_t cgroup;
+#else
   /* Flags bit mask.  */
   __aligned_uint64_t flags;
   /* Where to store PID file descriptor (pid_t *).  */
@@ -56,6 +80,7 @@ struct clone_args
   __aligned_uint64_t set_tid_size;
   /* File descriptor for target cgroup of child (since Linux 5.7).  */
   __aligned_uint64_t cgroup;
+#endif
 };
 
 /* The wrapper of clone3.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] TODO(uapi): cheri: fix clone_args
@ 2022-10-26 15:15 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:15 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3ecff512879b2f6cb90112e62f99f3205250c612

commit 3ecff512879b2f6cb90112e62f99f3205250c612
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Aug 2 11:34:56 2021 +0100

    TODO(uapi): cheri: fix clone_args
    
    Current clone_args does not support 128 bit pointers.
    
    TODO: the fix is incomplete (missing clone3 abi checks) and has to be
    aligned with purecap clone3 struct layout.

Diff:
---
 sysdeps/unix/sysv/linux/clone-internal.c |  2 ++
 sysdeps/unix/sysv/linux/clone3.h         | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
index a71effcbd3..8550fe9b24 100644
--- a/sysdeps/unix/sysv/linux/clone-internal.c
+++ b/sysdeps/unix/sysv/linux/clone-internal.c
@@ -32,6 +32,7 @@
 #define offsetofend(TYPE, MEMBER) \
   (offsetof (TYPE, MEMBER) + sizeof_field (TYPE, MEMBER))
 
+#ifndef __CHERI_PURE_CAPABILITY__
 _Static_assert (__alignof (struct clone_args) == 8,
 		"__alignof (struct clone_args) != 8");
 _Static_assert (offsetofend (struct clone_args, tls) == CLONE_ARGS_SIZE_VER0,
@@ -42,6 +43,7 @@ _Static_assert (offsetofend (struct clone_args, cgroup) == CLONE_ARGS_SIZE_VER2,
 		"offsetofend (struct clone_args, cgroup) != CLONE_ARGS_SIZE_VER2");
 _Static_assert (sizeof (struct clone_args) == CLONE_ARGS_SIZE_VER2,
 		"sizeof (struct clone_args) != CLONE_ARGS_SIZE_VER2");
+#endif
 
 int
 __clone_internal (struct clone_args *cl_args,
diff --git a/sysdeps/unix/sysv/linux/clone3.h b/sysdeps/unix/sysv/linux/clone3.h
index 889014a6a9..a3fc8deb29 100644
--- a/sysdeps/unix/sysv/linux/clone3.h
+++ b/sysdeps/unix/sysv/linux/clone3.h
@@ -34,6 +34,30 @@ typedef __U64_TYPE __aligned_uint64_t __attribute__ ((__aligned__ (8)));
 
 struct clone_args
 {
+#ifdef __CHERI_PURE_CAPABILITY__
+  /* Flags bit mask.  */
+  __uint64_t flags;
+  /* Where to store PID file descriptor (pid_t *).  */
+  __uintcap_t pidfd;
+  /* Where to store child TID, in child's memory (pid_t *).  */
+  __uintcap_t child_tid;
+  /* Where to store child TID, in parent's memory (int *). */
+  __uintcap_t parent_tid;
+  /* Signal to deliver to parent on child termination */
+  __uint64_t exit_signal;
+  /* The lowest address of stack.  */
+  __uintcap_t stack;
+  /* Size of stack.  */
+  __uint64_t stack_size;
+  /* Location of new TLS.  */
+  __uintcap_t tls;
+  /* Pointer to a pid_t array (since Linux 5.5).  */
+  __uintcap_t set_tid;
+  /* Number of elements in set_tid (since Linux 5.5). */
+  __uint64_t set_tid_size;
+  /* File descriptor for target cgroup of child (since Linux 5.7).  */
+  __uint64_t cgroup;
+#else
   /* Flags bit mask.  */
   __aligned_uint64_t flags;
   /* Where to store PID file descriptor (pid_t *).  */
@@ -56,6 +80,7 @@ struct clone_args
   __aligned_uint64_t set_tid_size;
   /* File descriptor for target cgroup of child (since Linux 5.7).  */
   __aligned_uint64_t cgroup;
+#endif
 };
 
 /* The wrapper of clone3.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-23 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 19:32 [glibc/arm/morello/main] TODO(uapi): cheri: fix clone_args Szabolcs Nagy
2022-10-26 15:15 Szabolcs Nagy
2022-10-27 13:53 Szabolcs Nagy
2022-11-23 14:43 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).