From cbeb1bde9f59cb560867f072eac3235c21b695fd Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Wed, 2 Aug 2023 20:56:16 +0100 Subject: [PATCH] linux glibc/musl and android adding PROT_BTI/PROT_MTE mmap flags for arm64. --- libc-test/semver/android-aarch64.txt | 2 ++ src/unix/linux_like/android/b64/aarch64/mod.rs | 3 +++ src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs | 3 +++ 3 files changed, 8 insertions(+) diff --git a/libc-test/semver/android-aarch64.txt b/libc-test/semver/android-aarch64.txt index 7a8868aa2c5de..9b4cc355e3f9e 100644 --- a/libc-test/semver/android-aarch64.txt +++ b/libc-test/semver/android-aarch64.txt @@ -7,6 +7,8 @@ HWCAP2_SVEBITPERM HWCAP2_SVEPMULL HWCAP2_SVESHA3 HWCAP2_SVESM4 +PROT_BTI +PROT_MTE SYS_arch_specific_syscall SYS_syscalls SYS_fcntl diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs index e7247fbb6f5fd..ac67fddabecd4 100644 --- a/src/unix/linux_like/android/b64/aarch64/mod.rs +++ b/src/unix/linux_like/android/b64/aarch64/mod.rs @@ -412,6 +412,9 @@ pub const SYS_fsmount: ::c_long = 432; pub const SYS_fspick: ::c_long = 433; pub const SYS_syscalls: ::c_long = 436; +pub const PROT_BTI: ::c_int = 0x10; +pub const PROT_MTE: ::c_int = 0x20; + cfg_if! { if #[cfg(libc_align)] { mod align; diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index fee3d1517f87a..f9aed99b2e788 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -902,6 +902,9 @@ pub const SYS_process_mrelease: ::c_long = 448; pub const SYS_futex_waitv: ::c_long = 449; pub const SYS_set_mempolicy_home_node: ::c_long = 450; +pub const PROT_BTI: ::c_int = 0x10; +pub const PROT_MTE: ::c_int = 0x20; + extern "C" { pub fn sysctl( name: *mut ::c_int,