MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / configure_pointer_authentication_keys

Function configure_pointer_authentication_keys

src/process/prctl.rs:1108–1137  ·  view source on GitHub ↗
(
    config: Config,
)

Source from the content-addressed store, hash-verified

1106#[doc(alias = "PR_PAC_SET_ENABLED_KEYS")]
1107#[cfg(linux_raw_dep)]
1108pub unsafe fn configure_pointer_authentication_keys<
1109 Config: Iterator<Item = (PointerAuthenticationKeys, bool)>,
1110>(
1111 config: Config,
1112) -> io::Result<()> {
1113 let mut affected_keys: u32 = 0;
1114 let mut enabled_keys: u32 = 0;
1115
1116 for (key, enable) in config {
1117 let key = key.bits();
1118 affected_keys |= key;
1119
1120 if enable {
1121 enabled_keys |= key;
1122 } else {
1123 enabled_keys &= !key;
1124 }
1125 }
1126
1127 if affected_keys == 0 {
1128 return Ok(()); // Nothing to do.
1129 }
1130
1131 prctl_3args(
1132 PR_PAC_SET_ENABLED_KEYS,
1133 affected_keys as usize as *mut _,
1134 enabled_keys as usize as *mut _,
1135 )
1136 .map(|_r| ())
1137}
1138
1139//
1140// PR_SET_VMA

Callers

nothing calls this directly

Calls 1

prctl_3argsFunction · 0.85

Tested by

no test coverage detected