diff options
author | Florian Weimer <fweimer@redhat.com> | 2017-12-05 15:20:30 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-12-05 15:20:35 +0100 |
commit | 446d22e91d3113be57a4b0d1151cf337458c3bec (patch) | |
tree | 933a5832d0cbd3aed24a722f1b28a6aefd95fb6c /ChangeLog | |
parent | da616c1496e2bd3022dbe4afdd162a80731c08ad (diff) | |
download | glibc-446d22e91d3113be57a4b0d1151cf337458c3bec.tar.gz glibc-446d22e91d3113be57a4b0d1151cf337458c3bec.tar.xz glibc-446d22e91d3113be57a4b0d1151cf337458c3bec.zip |
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 <adhemerval.zanella@linaro.org>
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 50ae82ba1d..333012ba81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,39 @@ 2017-12-05 Florian Weimer <fweimer@redhat.com> + Linux: Implement interfaces for memory protection keys + * support/Makefile (libsupport-routines): Add xraise, xsigaction, + xsignal, xsysconf. + * support/xsignal.h (xraise, xsignal, xsigaction): Declare. + * support/xunistd.h (xsysconf): Declare. + * support/xraise.c: New file. + * support/xsigaction.c: Likewise. + * support/xsignal.c: Likewise. + * support/xsysconf.c: Likewise. + * sysdeps/unix/sysv/linux/Makefile [misc] (routines): Add + pkey_set, pkey_get, pkey_mprotect. + [misc] (tests): Add tst-pkey. + (tst-pkey): Link with -lpthread. + * sysdeps/unix/sysv/linux/Versions (GLIBC_2.27): Add pkey_alloc, + pkey_free, pkey_set, pkey_get, pkey_mprotect. + * sysdeps/unix/sysv/linux/bits/mman-linux.h (PKEY_DISABLE_ACCESS) + (PKEY_DISABLE_WRITE): Define. + (pkey_alloc, pkey_free, pkey_set, pkey_get, pkey_mprotect): + Declare. + * sysdeps/unix/sysv/linux/bits/siginfo-consts.h (SEGV_BNDERR) + (SEGV_PKUERR): Add. + * sysdeps/unix/sysv/linux/pkey_get.c: New file. + * sysdeps/unix/sysv/linux/pkey_set.c: Likewise. + * sysdeps/unix/sysv/linux/pkey_mprotect.c: Likewise. + * sysdeps/unix/sysv/linux/syscalls.list (pkey_alloc, pkey_free): + Add. + * sysdeps/unix/sysv/linux/tst-pkey.c: New file. + * sysdeps/unix/sysv/linux/x86/arch-pkey.h: Likewise. + * sysdeps/unix/sysv/linux/x86/pkey_get.c: Likewise. + * sysdeps/unix/sysv/linux/x86/pkey_set.c: Likewise. + * sysdeps/unix/sysv/linux/**.abilist: Update. + +2017-12-05 Florian Weimer <fweimer@redhat.com> + * support/tst-test_compare.c (subprocess): Use long long instead of long argument for consistent type width across 32-bit and 64-bit architectures. |