aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-11-17 15:19:10 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-11-17 15:32:23 +0000
commit187b3dd4263cccc0087df3c4311ded95d866d116 (patch)
treeb8907ce6b1be36a0c9cc66e4c0238d4766ccecb7
parentf4c913ed552252ca91690e6c73ea02b10e263509 (diff)
downloadglibc-187b3dd4263cccc0087df3c4311ded95d866d116.zip
glibc-187b3dd4263cccc0087df3c4311ded95d866d116.tar.gz
glibc-187b3dd4263cccc0087df3c4311ded95d866d116.tar.bz2
cheri: Fix pselect signal mask argument
The signal mask argument is passed as a struct with a pointer and size in the linux syscall abi, but the types used in glibc were wrong for CHERI due to an x32 specific hack.
-rw-r--r--sysdeps/unix/sysv/linux/pselect.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/pselect.c b/sysdeps/unix/sysv/linux/pselect.c
index eba1c11..553de0a 100644
--- a/sysdeps/unix/sysv/linux/pselect.c
+++ b/sysdeps/unix/sysv/linux/pselect.c
@@ -27,12 +27,19 @@ pselect64_syscall (int nfds, fd_set *readfds, fd_set *writefds,
# define __NR_pselect6_time64 __NR_pselect6
#endif
/* NB: This is required by ARGIFY used in x32 internal_syscallN. */
- __syscall_ulong_t data[2] =
- {
- (uintptr_t) sigmask, __NSIG_BYTES
- };
+#ifdef __CHERI_PURE_CAPABILITY__
+ typedef uintptr_t kernel_ptr_t;
+ typedef size_t kernel_size_t;
+#else
+ typedef __syscall_ulong_t kernel_ptr_t;
+ typedef __syscall_ulong_t kernel_size_t;
+#endif
+ struct {
+ kernel_ptr_t ptr;
+ kernel_size_t size;
+ } data = { (uintptr_t) sigmask, __NSIG_BYTES };
return SYSCALL_CANCEL (pselect6_time64, nfds, readfds, writefds, exceptfds,
- timeout, data);
+ timeout, &data);
}
int