Lines Matching defs:pkey

69 			sigsafe_err("got a fault for an unexpected pkey\n");
79 * Reassociate the exec-only pkey with the region
106 int pkey, ret, i;
153 /* Allocate a pkey that restricts execution */
155 pkey = sys_pkey_alloc(0, rights);
156 FAIL_IF(pkey < 0);
170 * are not set i.e. the pkey permits both read and write
174 * implies PROT_READ on GNU systems. The pkey currently
179 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
180 printf("read from %p, pkey permissions are %s\n", fault_addr,
187 * are not set i.e. the pkey permits both read and write
191 * PROT_EXEC also restricts writes. The pkey currently
196 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
197 printf("write to %p, pkey permissions are %s\n", fault_addr,
205 fault_pkey = pkey;
209 * are set i.e. the pkey permits neither read nor write
212 * This should generate a pkey fault based on AMR bits only
216 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
217 pkey_set_rights(pkey, rights);
218 printf("read from %p, pkey permissions are %s\n", fault_addr,
225 * are set i.e. the pkey permits neither read nor write
228 * This should generate two faults. First, a pkey fault
233 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
234 pkey_set_rights(pkey, rights);
235 printf("write to %p, pkey permissions are %s\n", fault_addr,
240 /* Free the current pkey */
241 sys_pkey_free(pkey);
249 pkey = sys_pkey_alloc(0, rights);
250 FAIL_IF(pkey < 0);
256 * This should generate pkey faults based on IAMR bits which
262 fault_pkey = pkey;
270 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0);
271 printf("execute at %p, pkey permissions are %s\n", fault_addr,
278 /* Free the current pkey */
279 sys_pkey_free(pkey);
281 /* Find next valid combination of pkey rights */