Lines Matching +full:protect +full:- +full:exec

1 // SPDX-License-Identifier: GPL-2.0
44 if (sinfo->si_code != SEGV_PKUERR) { in segv_handler()
50 if (sinfo->si_addr != (void *) fault_addr) { in segv_handler()
68 pgstart = (void *) ((unsigned long) fault_addr & ~(pgsize - 1)); in segv_handler()
72 * reassociate the page with the exec-only pkey since execute in segv_handler()
77 * read-write rights, change the AMR permission bits for the in segv_handler()
97 static void *protect(void *p) in protect() function
105 base = ((struct region *) p)->base; in protect()
106 size = ((struct region *) p)->size; in protect()
119 * Repeatedly try to protect the common region with a permissive in protect()
147 base = ((struct region *) p)->base; in protect_access()
148 size = ((struct region *) p)->size; in protect_access()
149 rights = ((struct region *) p)->rights; in protect_access()
164 * Repeatedly try to protect the common region with a restrictive in protect_access()
257 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in test()
261 * Fill the region with no-ops with a branch at the end in test()
265 for (i = 0; i < numinsns - 1; i++) in test()
287 * the one from the protect-and-access thread since the other in test()
294 /* Setup barrier for protect and protect-and-access threads */ in test()
298 /* Setup and start protect and protect-and-read threads */ in test()
299 puts("starting thread pair (protect, protect-and-read)"); in test()
301 FAIL_IF(pthread_create(&prot_thread, &attr, &protect, &r) != 0); in test()
306 /* Setup and start protect and protect-and-write threads */ in test()
307 puts("starting thread pair (protect, protect-and-write)"); in test()
309 FAIL_IF(pthread_create(&prot_thread, &attr, &protect, &r) != 0); in test()
314 /* Setup and start protect and protect-and-execute threads */ in test()
315 puts("starting thread pair (protect, protect-and-execute)"); in test()
317 FAIL_IF(pthread_create(&prot_thread, &attr, &protect, &r) != 0); in test()