[PATCH 3/5] linux: Implement pkey_alloc in C (BZ 34917)

Florian Weimer fweimer@redhat.com
Fri Nov 6 09:40:37 GMT 2026


* Adhemerval Zanella:

> The kernel declares the pkey_alloc flags and access rights as unsigned
> long, and fails with EINVAL if the flags are nonzero or the access
> rights have an unknown bit, including bits 32 to 63.
>
> Implement pkey_alloc in C, where INLINE_SYSCALL_CALL zero-extends the
> arguments to the full register on these ABIs.
>
> Checked on x86_64-linux-gnu and aarch64-linux-gnu.
> ---
>  sysdeps/unix/sysv/linux/Makefile              |  1 +
>  sysdeps/unix/sysv/linux/pkey_alloc.c          | 28 ++++++++++++++++
>  sysdeps/unix/sysv/linux/syscalls.list         |  1 -
>  .../unix/sysv/linux/tst-syscall-upper-bits.c  | 32 +++++++++++++++++++
>  4 files changed, 61 insertions(+), 1 deletion(-)
>  create mode 100644 sysdeps/unix/sysv/linux/pkey_alloc.c

Okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian



More information about the Libc-alpha mailing list