/linux-master/tools/testing/selftests/powerpc/mm/ |
H A D | exec_prot.c | 73 if (mprotect(insns, pgsize, PROT_READ | PROT_WRITE | PROT_EXEC)) { 98 FAIL_IF(mprotect(insns, pgsize, rights) != 0); 173 FAIL_IF(mprotect(insns, pgsize, PROT_EXEC) != 0); 185 FAIL_IF(mprotect(insns, pgsize, PROT_EXEC) != 0);
|
H A D | pkey_exec_prot.c | 62 if (mprotect(insns, pgsize, PROT_READ | PROT_WRITE)) { 84 if (mprotect(insns, pgsize, PROT_EXEC)) {
|
H A D | tlbie_test.c | 577 mprotect(map1, size, PROT_READ); 597 mprotect(map1, size, PROT_READ|PROT_WRITE);
|
H A D | pkey_siginfo.c | 83 mprotect(pgstart, pgsize, PROT_EXEC))
|
/linux-master/tools/testing/selftests/powerpc/primitives/ |
H A D | load_unaligned_zeropad.c | 4 * pages and uses mprotect to prevent access to the second page and 9 * performed while access to the second page is enabled via mprotect. 43 if (mprotect(mem_region + page_size, page_size, PROT_NONE)) { 44 perror("mprotect"); 53 if (mprotect(mem_region + page_size, page_size, PROT_READ|PROT_WRITE)) { 54 perror("mprotect");
|
/linux-master/arch/um/kernel/ |
H A D | tlb.c | 36 } mprotect; member in union:host_vm_change::host_vm_op::__anon20 97 op->u.mprotect.addr, 98 op->u.mprotect.len, 99 op->u.mprotect.prot, 103 (void *) op->u.mprotect.addr, 104 op->u.mprotect.len, 195 (last->u.mprotect.addr + last->u.mprotect.len == addr) && 196 (last->u.mprotect.prot == prot)) { 197 last->u.mprotect [all...] |
/linux-master/tools/testing/selftests/mm/ |
H A D | mkdirty.c | 173 if (mprotect(mem, pagesize, PROT_READ)) { 174 ksft_test_result_fail("mprotect() failed\n"); 206 if (mprotect(mem, thpsize, PROT_READ)) { 207 ksft_test_result_fail("mprotect() failed\n"); 245 if (mprotect(mem, thpsize, PROT_READ)) { 246 ksft_test_result_fail("mprotect() failed\n"); 256 /* Trigger PTE-mapping the THP by mprotect'ing the last subpage. */ 257 if (mprotect(mem + thpsize - pagesize, pagesize, 259 ksft_test_result_fail("mprotect() failed\n");
|
H A D | soft-dirty.c | 161 mprotect(map, pagesize, PROT_READ); 165 mprotect(map, pagesize, PROT_READ|PROT_WRITE);
|
H A D | mdwe_test.c | 241 ret = mprotect(self->p, self->size, PROT_READ | PROT_EXEC); 252 ret = mprotect(self->p, self->size, PROT_READ | PROT_EXEC); 267 ret = mprotect(self->p, self->size, PROT_WRITE | PROT_EXEC); 300 ret = mprotect(self->p, self->size, PROT_EXEC | PROT_BTI);
|
H A D | pagemap_ioctl.c | 198 mprotect(mem, mem_size/8, PROT_READ|PROT_WRITE); 199 mprotect(mem + 1 * mem_size/8, mem_size/8, PROT_READ); 200 mprotect(mem + 2 * mem_size/8, mem_size/8, PROT_READ|PROT_WRITE); 201 mprotect(mem + 3 * mem_size/8, mem_size/8, PROT_READ); 202 mprotect(mem + 4 * mem_size/8, mem_size/8, PROT_READ|PROT_WRITE); 203 mprotect(mem + 5 * mem_size/8, mem_size/8, PROT_NONE); 204 mprotect(mem + 6 * mem_size/8, mem_size/8, PROT_READ|PROT_WRITE); 205 mprotect(mem + 7 * mem_size/8, mem_size/8, PROT_READ); 1265 mprotect(mem, page_size, PROT_NONE); 1266 mprotect(me [all...] |
H A D | cow.c | 227 * mprotect() optimizations might try avoiding 230 ret = mprotect(mem, size, PROT_READ); 231 ret |= mprotect(mem, size, PROT_READ|PROT_WRITE); 233 ksft_test_result_fail("mprotect() failed\n"); 457 * again by mprotect() optimizations. Note that we don't have an 461 ret = mprotect(mem, size, PROT_READ); 463 ret |= mprotect(mem, size, PROT_READ | PROT_WRITE); 465 ksft_test_result_fail("mprotect() failed\n"); 617 * again by mprotect() optimizations. Note that we don't have an 621 ret = mprotect(me [all...] |
H A D | hmm-tests.c | 329 ret = mprotect(buffer->ptr, size, PROT_READ); 354 * mprotect() PROT_NONE. 392 ret = mprotect(buffer->ptr, size, PROT_NONE); 400 ret = mprotect(buffer->ptr, size, PROT_READ); 461 * mprotect() PROT_READ. 509 ret = mprotect(buffer->ptr, size, PROT_WRITE | PROT_READ); 1191 ret = mprotect(buffer->ptr + 2 * self->page_size, self->page_size, 1199 ret = mprotect(buffer->ptr + 3 * self->page_size, self->page_size, 1204 ret = mprotect(buffer->ptr + 3 * self->page_size, self->page_size, 1209 ret = mprotect(buffe [all...] |
/linux-master/tools/testing/selftests/kvm/s390x/ |
H A D | tprot.c | 86 * Since the page tables are shared, the host uses mprotect to achieve 99 * host: write protect both via mprotect 219 mprotect(addr_gva2hva(vm, (vm_vaddr_t)pages), PAGE_SIZE * 2, PROT_READ); 232 mprotect(addr_gva2hva(vm, (vm_vaddr_t)0), PAGE_SIZE, PROT_READ);
|
/linux-master/arch/x86/um/os-Linux/ |
H A D | task_size.c | 53 } else if (mprotect(address, UM_KERN_PAGE_SIZE,
|
/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | test_lsm.c | 32 ret = mprotect(GET_PAGE_ADDR(buf, sz), sz,
|
H A D | ringbuf.c | 115 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_cons_pos_protect"); 139 ASSERT_ERR(mprotect(mmap_ptr, 4 * page_size, PROT_WRITE), "write_protect"); 140 ASSERT_ERR(mprotect(mmap_ptr, 4 * page_size, PROT_EXEC), "exec_protect"); 149 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_WRITE), "write_protect"); 150 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_protect");
|
H A D | mmap.c | 135 err = mprotect(map_mmaped, map_sz, PROT_READ); 136 if (CHECK(err, "mprotect_ro", "mprotect to r/o failed %d\n", errno)) 152 err = mprotect(map_mmaped, map_sz, PROT_WRITE); 153 if (CHECK(!err, "mprotect_wr", "mprotect() succeeded unexpectedly!\n")) 155 err = mprotect(map_mmaped, map_sz, PROT_EXEC); 156 if (CHECK(!err, "mprotect_ex", "mprotect() succeeded unexpectedly!\n"))
|
H A D | user_ringbuf.c | 110 /* cons_pos can be mapped R/O, can't add +X with mprotect. */ 113 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_WRITE), "write_cons_pos_protect"); 114 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_cons_pos_protect"); 120 /* prod_pos can be mapped RW, can't add +X with mprotect. */ 124 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_prod_pos_protect"); 129 /* data pages can be mapped RW, can't add +X with mprotect. */ 133 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_data_protect");
|
/linux-master/tools/testing/selftests/powerpc/copyloops/ |
H A D | exc_validate.c | 98 if (mprotect(p + page_size, page_size, PROT_NONE)) { 99 perror("mprotect");
|
/linux-master/tools/testing/selftests/powerpc/signal/ |
H A D | sigreturn_vdso.c | 114 mprotect((void *)low, size, PROT_READ|PROT_WRITE|PROT_EXEC);
|
/linux-master/tools/testing/selftests/x86/ |
H A D | test_shadow_stack.c | 409 /* mprotect a shadow stack as read only */ 411 if (mprotect(shstk_ptr, SS_SIZE, PROT_READ) < 0) { 426 if (mprotect(shstk_ptr, SS_SIZE, PROT_READ) < 0) { 432 if (mprotect(shstk_ptr, SS_SIZE, PROT_WRITE | PROT_READ) < 0) { 439 printf("[FAIL]\tShadow stack access to mprotect() writable memory failed\n"); 843 printf("[FAIL]\tShadow shadow mprotect test\n");
|
/linux-master/arch/um/os-Linux/ |
H A D | util.c | 23 if (mprotect((void *) address, UM_THREAD_SIZE,
|
H A D | process.c | 159 if (mprotect(addr, len, prot) < 0)
|
/linux-master/tools/testing/selftests/arm64/mte/ |
H A D | check_mmap_options.c | 147 if (mprotect(map_ptr, map_size, prot_flag)) { 150 ksft_print_msg("FAIL: mprotect not ignoring clear PROT_MTE property\n"); 170 if (mprotect(map_ptr, map_size, prot_flag)) { 171 ksft_print_msg("FAIL: mprotect not ignoring clear PROT_MTE property\n"); 215 "Check file memory with private mapping, sync error mode, mmap/mprotect memory and tag check off\n"); 221 "Check file memory with private mapping, no error mode, mmap/mprotect memory and tag check off\n"); 226 "Check anonymous memory with private mapping, sync error mode, mmap/mprotect memory and tag check on\n"); 230 "Check anonymous memory with shared mapping, sync error mode, mmap/mprotect memory and tag check on\n"); 234 "Check anonymous memory with private mapping, async error mode, mmap/mprotect memory and tag check on\n"); 238 "Check anonymous memory with shared mapping, async error mode, mmap/mprotect memor [all...] |
/linux-master/mm/ |
H A D | mprotect.c | 3 * mm/mprotect.c 526 * Ordinary protection updates (mprotect, uffd-wp, softdirty tracking) 678 * pkey==-1 when doing a legacy mprotect() 768 * Each mprotect() call explicitly passes r/w/x permissions. 769 * If a permission is not passed to mprotect(), it must be 803 if (vma->vm_ops && vma->vm_ops->mprotect) { 804 error = vma->vm_ops->mprotect(vma, nstart, tmp, newflags); 827 SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
|