From 446d22e91d3113be57a4b0d1151cf337458c3bec Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 5 Dec 2017 15:20:30 +0100 Subject: Linux: Implement interfaces for memory protection keys This adds system call wrappers for pkey_alloc, pkey_free, pkey_mprotect, and x86-64 implementations of pkey_get and pkey_set, which abstract over the PKRU CPU register and hide the actual number of memory protection keys supported by the CPU. pkey_mprotect with a -1 key is implemented using mprotect, so it will work even if the kernel does not support the pkey_mprotect system call. The system call wrapers use unsigned int instead of unsigned long for parameters, so that no special treatment for x32 is needed. The flags argument is currently unused, and the access rights bit mask is limited to two bits by the current PKRU register layout anyway. Reviewed-by: Adhemerval Zanella --- support/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'support/Makefile') diff --git a/support/Makefile b/support/Makefile index bb81825fc2..bfde79333e 100644 --- a/support/Makefile +++ b/support/Makefile @@ -87,8 +87,8 @@ libsupport-routines = \ xpthread_attr_destroy \ xpthread_attr_init \ xpthread_attr_setdetachstate \ - xpthread_attr_setstacksize \ xpthread_attr_setguardsize \ + xpthread_attr_setstacksize \ xpthread_barrier_destroy \ xpthread_barrier_init \ xpthread_barrier_wait \ @@ -119,14 +119,18 @@ libsupport-routines = \ xpthread_sigmask \ xpthread_spin_lock \ xpthread_spin_unlock \ + xraise \ xreadlink \ xrealloc \ xrecvfrom \ xsendto \ xsetsockopt \ + xsigaction \ + xsignal \ xsocket \ xstrdup \ xstrndup \ + xsysconf \ xunlink \ xwaitpid \ xwrite \ -- cgit v1.2.3-65-gdbad