Skip to content

Commit a2f7dac

Browse files
committed
Auto merge of #2837 - devnexen:linux_ptr_auth_followup, r=JohnTitor
linux arm64 pointer, prctl auth control follow-up.
2 parents ce3d1a2 + fbe15c6 commit a2f7dac

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3182,6 +3182,9 @@ fn test_linux(target: &str) {
31823182
// GRND_INSECURE was added in glibc-2.32
31833183
"GRND_INSECURE" => true,
31843184

3185+
// present in recent kernels only
3186+
"PR_PAC_SET_ENABLED_KEYS" | "PR_PAC_GET_ENABLED_KEYS" => true,
3187+
31853188
_ => false,
31863189
}
31873190
});

src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,20 @@ pub const HWCAP_PACG: ::c_ulong = 1 << 31;
576576
//pub const HWCAP2_MTE: ::c_ulong = 1 << 18;
577577

578578
// linux/prctl.h
579+
pub const PR_PAC_RESET_KEYS: ::c_int = 54;
579580
pub const PR_SET_TAGGED_ADDR_CTRL: ::c_int = 55;
580581
pub const PR_GET_TAGGED_ADDR_CTRL: ::c_int = 56;
582+
pub const PR_PAC_SET_ENABLED_KEYS: ::c_int = 60;
583+
pub const PR_PAC_GET_ENABLED_KEYS: ::c_int = 61;
584+
581585
pub const PR_TAGGED_ADDR_ENABLE: ::c_ulong = 1;
582586

587+
pub const PR_PAC_APIAKEY: ::c_ulong = 1 << 0;
588+
pub const PR_PAC_APIBKEY: ::c_ulong = 1 << 1;
589+
pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2;
590+
pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3;
591+
pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4;
592+
583593
// Syscall table
584594
pub const SYS_io_setup: ::c_long = 0;
585595
pub const SYS_io_destroy: ::c_long = 1;

0 commit comments

Comments
 (0)