[v4,02/14] aarch64: Enable internal use of memory protection keys

Message ID 54aac713a1f1c3d25c15424e0a1245e5477aea95.1738530302.git.fweimer@redhat.com (mailing list archive)
State Accepted
Headers
Series RELRO link maps |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed

Commit Message

Florian Weimer Feb. 2, 2025, 9:12 p.m. UTC
  This adds hidden prototypes to align with commit 7e21a65c58cc91b3ba
("misc: Enable internal use of memory protection keys").
---
 sysdeps/unix/sysv/linux/aarch64/pkey_get.c | 4 +++-
 sysdeps/unix/sysv/linux/aarch64/pkey_set.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
  

Comments

Adhemerval Zanella Netto March 17, 2025, 12:24 p.m. UTC | #1
On 02/02/25 18:12, Florian Weimer wrote:
> This adds hidden prototypes to align with commit 7e21a65c58cc91b3ba
> ("misc: Enable internal use of memory protection keys").

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/unix/sysv/linux/aarch64/pkey_get.c | 4 +++-
>  sysdeps/unix/sysv/linux/aarch64/pkey_set.c | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/aarch64/pkey_get.c b/sysdeps/unix/sysv/linux/aarch64/pkey_get.c
> index 2dd9d8165e..73921e21e3 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/pkey_get.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/pkey_get.c
> @@ -21,7 +21,7 @@
>  #include <sys/mman.h>
>  
>  int
> -pkey_get (int key)
> +__pkey_get (int key)
>  {
>    if (key < 0 || key > 15)
>      {
> @@ -71,3 +71,5 @@ pkey_get (int key)
>  
>    return PKEY_DISABLE_ACCESS;
>  }
> +libc_hidden_def (__pkey_get)
> +weak_alias (__pkey_get, pkey_get)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/pkey_set.c b/sysdeps/unix/sysv/linux/aarch64/pkey_set.c
> index a521cc00da..45a4992997 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/pkey_set.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/pkey_set.c
> @@ -24,7 +24,7 @@
>    PKEY_DISABLE_WRITE | PKEY_DISABLE_EXECUTE | PKEY_DISABLE_READ)
>  
>  int
> -pkey_set (int key, unsigned int restrictions)
> +__pkey_set (int key, unsigned int restrictions)
>  {
>    if (key < 0 || key > 15 || restrictions > MAX_PKEY_RIGHTS)
>      {
> @@ -111,3 +111,5 @@ pkey_set (int key, unsigned int restrictions)
>    pkey_write (por_el0);
>    return 0;
>  }
> +libc_hidden_def (__pkey_set)
> +weak_alias (__pkey_set, pkey_set)
  

Patch

diff --git a/sysdeps/unix/sysv/linux/aarch64/pkey_get.c b/sysdeps/unix/sysv/linux/aarch64/pkey_get.c
index 2dd9d8165e..73921e21e3 100644
--- a/sysdeps/unix/sysv/linux/aarch64/pkey_get.c
+++ b/sysdeps/unix/sysv/linux/aarch64/pkey_get.c
@@ -21,7 +21,7 @@ 
 #include <sys/mman.h>
 
 int
-pkey_get (int key)
+__pkey_get (int key)
 {
   if (key < 0 || key > 15)
     {
@@ -71,3 +71,5 @@  pkey_get (int key)
 
   return PKEY_DISABLE_ACCESS;
 }
+libc_hidden_def (__pkey_get)
+weak_alias (__pkey_get, pkey_get)
diff --git a/sysdeps/unix/sysv/linux/aarch64/pkey_set.c b/sysdeps/unix/sysv/linux/aarch64/pkey_set.c
index a521cc00da..45a4992997 100644
--- a/sysdeps/unix/sysv/linux/aarch64/pkey_set.c
+++ b/sysdeps/unix/sysv/linux/aarch64/pkey_set.c
@@ -24,7 +24,7 @@ 
   PKEY_DISABLE_WRITE | PKEY_DISABLE_EXECUTE | PKEY_DISABLE_READ)
 
 int
-pkey_set (int key, unsigned int restrictions)
+__pkey_set (int key, unsigned int restrictions)
 {
   if (key < 0 || key > 15 || restrictions > MAX_PKEY_RIGHTS)
     {
@@ -111,3 +111,5 @@  pkey_set (int key, unsigned int restrictions)
   pkey_write (por_el0);
   return 0;
 }
+libc_hidden_def (__pkey_set)
+weak_alias (__pkey_set, pkey_set)