Searched refs:mprotect (Results 1 - 25 of 36) sorted by path

12

/linux-master/tools/testing/selftests/powerpc/copyloops/
H A Dexc_validate.c98 if (mprotect(p + page_size, page_size, PROT_NONE)) {
99 perror("mprotect");
/linux-master/tools/testing/selftests/powerpc/primitives/
H A Dload_unaligned_zeropad.c4 * 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 Dtlb.c36 } 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/arch/um/os-Linux/
H A Dprocess.c159 if (mprotect(addr, len, prot) < 0)
H A Dutil.c23 if (mprotect((void *) address, UM_THREAD_SIZE,
/linux-master/arch/x86/kernel/cpu/sgx/
H A Dencl.c688 .mprotect = sgx_vma_mprotect,
/linux-master/arch/x86/um/os-Linux/
H A Dtask_size.c53 } else if (mprotect(address, UM_KERN_PAGE_SIZE,
/linux-master/include/linux/
H A Dmm.h272 /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
273 #define VM_MAYREAD 0x00000010 /* limits for mprotect() etc */
583 * Called by mprotect() to make driver-specific permission
584 * checks before mprotect() is finalised. The VMA must not
585 * be modified. Returns 0 if mprotect() can proceed.
587 int (*mprotect)(struct vm_area_struct *vma, unsigned long start, member in struct:vm_operations_struct
1635 * ptrace does not apply. Note that there is no mprotect() to upgrade
4213 * MAP_SHARED and read-only, take care to not allow mprotect to
/linux-master/kernel/
H A Dsys_ni.c181 COND_SYSCALL(mprotect); variable
/linux-master/mm/
H A DMakefile37 mlock.o mmap.o mmu_gather.o mprotect.o mremap.o \
H A Dmprotect.c3 * mm/mprotect.c
527 * Ordinary protection updates (mprotect, uffd-wp, softdirty tracking)
679 * pkey==-1 when doing a legacy mprotect()
769 * Each mprotect() call explicitly passes r/w/x permissions.
770 * If a permission is not passed to mprotect(), it must be
804 if (vma->vm_ops && vma->vm_ops->mprotect) {
805 error = vma->vm_ops->mprotect(vma, nstart, tmp, newflags);
828 SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
/linux-master/tools/testing/selftests/arm64/mte/
H A Dcheck_mmap_options.c147 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...]
H A Dmte_common_util.c157 if (mprotect(ptr, entire_size, prot_flag | PROT_MTE)) {
159 ksft_print_msg("FAIL: mprotect PROT_MTE property\n");
/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dmmap.c135 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 Dringbuf.c116 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_cons_pos_protect");
140 ASSERT_ERR(mprotect(mmap_ptr, 4 * page_size, PROT_WRITE), "write_protect");
141 ASSERT_ERR(mprotect(mmap_ptr, 4 * page_size, PROT_EXEC), "exec_protect");
150 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_WRITE), "write_protect");
151 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_protect");
H A Dtest_lsm.c32 ret = mprotect(GET_PAGE_ADDR(buf, sz), sz,
H A Duser_ringbuf.c110 /* 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/kvm/s390x/
H A Dtprot.c87 * Since the page tables are shared, the host uses mprotect to achieve
100 * host: write protect both via mprotect
220 mprotect(addr_gva2hva(vm, (vm_vaddr_t)pages), PAGE_SIZE * 2, PROT_READ);
233 mprotect(addr_gva2hva(vm, (vm_vaddr_t)0), PAGE_SIZE, PROT_READ);
/linux-master/tools/testing/selftests/memfd/
H A Dmemfd_test.c470 * mprotect(PROT_WRITE) allows writing */
482 r = mprotect(p, mfd_def_size, PROT_READ | PROT_WRITE);
484 printf("mprotect() failed: %m\n");
539 /* Verify PROT_READ with MAP_SHARED with a following mprotect is not
548 r = mprotect(p, mfd_def_size, PROT_READ | PROT_WRITE);
550 printf("mmap()+mprotect() didn't fail as expected\n");
/linux-master/tools/testing/selftests/mm/
H A Dcow.c227 * 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");
481 * again by mprotect() optimizations. Note that we don't have an
485 ret = mprotect(mem, size, PROT_READ);
487 ret |= mprotect(mem, size, PROT_READ | PROT_WRITE);
489 ksft_test_result_fail("mprotect() failed\n");
641 * again by mprotect() optimizations. Note that we don't have an
645 ret = mprotect(me
[all...]
H A Dgup_longterm.c131 ret = mprotect(mem, size, PROT_READ);
133 ksft_test_result_fail("mprotect() failed\n");
H A Dhmm-tests.c329 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...]
H A Dksm_functional_tests.c192 if (mprotect(map, size, prot)) {
193 ksft_print_msg("mprotect() failed\n");
H A Dksm_tests.c209 if (mprotect(map_ptr, map_size, prot)) {
210 perror("mprotect");
H A Dmdwe_test.c241 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);

Completed in 561 milliseconds

12