Skip to content

linux arm64 pointer, prctl auth control follow-up. #2837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3182,6 +3182,9 @@ fn test_linux(target: &str) {
// GRND_INSECURE was added in glibc-2.32
"GRND_INSECURE" => true,

// present in recent kernels only
"PR_PAC_SET_ENABLED_KEYS" | "PR_PAC_GET_ENABLED_KEYS" => true,

_ => false,
}
});
Expand Down
10 changes: 10 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,20 @@ pub const HWCAP_PACG: ::c_ulong = 1 << 31;
//pub const HWCAP2_MTE: ::c_ulong = 1 << 18;

// linux/prctl.h
pub const PR_PAC_RESET_KEYS: ::c_int = 54;
pub const PR_SET_TAGGED_ADDR_CTRL: ::c_int = 55;
pub const PR_GET_TAGGED_ADDR_CTRL: ::c_int = 56;
pub const PR_PAC_SET_ENABLED_KEYS: ::c_int = 60;
pub const PR_PAC_GET_ENABLED_KEYS: ::c_int = 61;

pub const PR_TAGGED_ADDR_ENABLE: ::c_ulong = 1;

pub const PR_PAC_APIAKEY: ::c_ulong = 1 << 0;
pub const PR_PAC_APIBKEY: ::c_ulong = 1 << 1;
pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2;
pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3;
pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4;

// Syscall table
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
Expand Down