/linux/tools/testing/selftests/mm/ |
H A D | mseal_test.c | 174 ptr = mmap(NULL, size, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in setup_single_address() 183 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, mapflags, -1, 0); in setup_single_address_rw() 207 ptr = mmap(NULL, page_size, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in seal_support() 260 ret = sys_mprotect(ptr, size, PROT_READ | PROT_WRITE); in test_seal_unmapped_start() 288 ret = sys_mprotect(ptr, size, PROT_READ | PROT_WRITE); in test_seal_unmapped_middle() 320 ret = sys_mprotect(ptr, size, PROT_READ | PROT_WRITE); in test_seal_unmapped_end() 346 PROT_READ | PROT_WRITE); in test_seal_multiple_vmas() 350 ret = sys_mprotect(ptr, size, PROT_READ); in test_seal_multiple_vmas() 355 PROT_READ | PROT_WRITE); in test_seal_multiple_vmas() 376 ret = sys_mprotect(ptr, 2 * page_size, PROT_READ | PROT_WRITE); in test_seal_split_start() [all …]
|
H A D | mkdirty.c | 94 mem = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE|MAP_ANON, -1, 0); in test_ptrace_write() 131 mem = mmap_thp_range(PROT_READ, &mmap_mem, &mmap_size); in test_ptrace_write_thp() 164 mem = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, in test_page_migration() 173 if (mprotect(mem, pagesize, PROT_READ)) { in test_page_migration() 197 mem = mmap_thp_range(PROT_READ|PROT_WRITE, &mmap_mem, &mmap_size); in test_page_migration_thp() 206 if (mprotect(mem, thpsize, PROT_READ)) { in test_page_migration_thp() 236 mem = mmap_thp_range(PROT_READ|PROT_WRITE, &mmap_mem, &mmap_size); in test_pte_mapped_thp() 245 if (mprotect(mem, thpsize, PROT_READ)) { in test_pte_mapped_thp() 258 PROT_READ|PROT_WRITE)) { in test_pte_mapped_thp() 280 dst = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE|MAP_ANON, -1, 0); in test_uffdio_copy()
|
H A D | mremap_dontunmap.c | 100 mmap(NULL, num_pages * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_simple() 140 mmap(NULL, num_pages * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_simple_shmem() 190 mmap(NULL, num_pages * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_simple_fixed() 196 mmap(NULL, num_pages * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_simple_fixed() 247 mmap(NULL, num_pages * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_partial_mapping() 300 mmap(NULL, 5 * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_partial_mapping_overwrite() 306 mmap(NULL, 10 * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_partial_mapping_overwrite() 355 mmap(NULL, page_size, PROT_READ | PROT_WRITE, in main()
|
H A D | soft-dirty.c | 52 map = mmap(NULL, pagesize, (PROT_READ | PROT_WRITE), (MAP_PRIVATE | MAP_ANON), -1, 0); in test_vma_reuse() 63 map2 = mmap(NULL, pagesize, (PROT_READ | PROT_WRITE), (MAP_PRIVATE | MAP_ANON), -1, 0); in test_vma_reuse() 135 map = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in test_mprotect() 147 map = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in test_mprotect() 161 mprotect(map, pagesize, PROT_READ); in test_mprotect() 165 mprotect(map, pagesize, PROT_READ|PROT_WRITE); in test_mprotect()
|
H A D | hugetlb-madvise.c | 98 PROT_READ | PROT_WRITE, in main() 140 PROT_READ | PROT_WRITE, in main() 178 PROT_READ | PROT_WRITE, in main() 208 PROT_READ | PROT_WRITE, in main() 267 PROT_READ | PROT_WRITE, in main() 307 PROT_READ | PROT_WRITE, in main() 319 PROT_READ | PROT_WRITE, in main()
|
H A D | seal_elf.c | 48 ptr = mmap(NULL, page_size, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in seal_support() 81 ret = sys_mprotect((void *)ptr, page_size, PROT_READ|PROT_WRITE); in test_seal_elf() 85 ret = sys_mprotect((void *)ptr, page_size, PROT_READ); in test_seal_elf() 115 ret = sys_mprotect((void *)ptr, page_size, PROT_READ | PROT_WRITE); in test_seal_elf()
|
H A D | cow.c | 230 ret = mprotect(mem, size, PROT_READ); in do_test_cow_in_parent() 231 ret |= mprotect(mem, size, PROT_READ|PROT_WRITE); in do_test_cow_in_parent() 485 ret = mprotect(mem, size, PROT_READ); in do_test_iouring() 487 ret |= mprotect(mem, size, PROT_READ | PROT_WRITE); in do_test_iouring() 645 ret = mprotect(mem, size, PROT_READ); in do_test_ro_pin() 647 ret |= mprotect(mem, size, PROT_READ | PROT_WRITE); in do_test_ro_pin() 746 mem = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, in do_run_with_base_page() 807 mmap_mem = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, in do_run_with_thp() 847 ret = mprotect(mem + pagesize, pagesize, PROT_READ); in do_run_with_thp() 852 ret = mprotect(mem + pagesize, pagesize, PROT_READ | PROT_WRIT in do_run_with_thp() [all...] |
H A D | hmm-tests.c | 315 PROT_READ | PROT_WRITE, in TEST_F() 329 ret = mprotect(buffer->ptr, size, PROT_READ); in TEST_F() 378 PROT_READ | PROT_WRITE, in TEST_F() 400 ret = mprotect(buffer->ptr, size, PROT_READ); in TEST_F() 437 PROT_READ | PROT_WRITE, in TEST_F() 485 PROT_READ, in TEST_F() 509 ret = mprotect(buffer->ptr, size, PROT_WRITE | PROT_READ); in TEST_F() 553 PROT_READ | PROT_WRITE, in TEST_F() 631 PROT_READ | PROT_WRITE, in TEST_F() 706 PROT_READ | PROT_WRITE, in TEST_F() [all …]
|
H A D | mdwe_test.c | 219 self->p = mmap(NULL, self->size, PROT_READ | PROT_EXEC, self->flags, 0, 0); in TEST_F() 237 self->p = mmap(NULL, self->size, PROT_READ | PROT_EXEC, self->flags, 0, 0); in TEST_F() 240 ret = mprotect(self->p, self->size, PROT_READ | PROT_EXEC); in TEST_F() 248 self->p = mmap(NULL, self->size, PROT_READ, self->flags, 0, 0); in TEST_F() 251 ret = mprotect(self->p, self->size, PROT_READ | PROT_EXEC); in TEST_F() 278 self->p = mmap(NULL, self->size, PROT_READ, self->flags, 0, 0); in TEST_F() 282 p = mmap(self->p, self->size, PROT_READ | PROT_EXEC, in TEST_F()
|
H A D | madv_populate.c | 35 addr = mmap(0, pagesize, PROT_READ | PROT_WRITE, in sense_support() 58 addr = mmap(0, SIZE, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); in test_prot_read() 100 addr = mmap(0, SIZE, PROT_READ | PROT_WRITE, in test_holes() 170 addr = mmap(0, SIZE, PROT_READ | PROT_WRITE, in test_populate_read() 192 addr = mmap(0, SIZE, PROT_READ | PROT_WRITE, in test_populate_write() 242 addr = mmap(0, SIZE, PROT_READ | PROT_WRITE, in test_softdirty()
|
H A D | pagemap_ioctl.c | 176 mem = mmap(NULL, size, PROT_READ | PROT_WRITE, in gethugetlb_mem() 198 mprotect(mem, mem_size/8, PROT_READ|PROT_WRITE); in userfaultfd_tests() 199 mprotect(mem + 1 * mem_size/8, mem_size/8, PROT_READ); in userfaultfd_tests() 200 mprotect(mem + 2 * mem_size/8, mem_size/8, PROT_READ|PROT_WRITE); in userfaultfd_tests() 201 mprotect(mem + 3 * mem_size/8, mem_size/8, PROT_READ); in userfaultfd_tests() 202 mprotect(mem + 4 * mem_size/8, mem_size/8, PROT_READ|PROT_WRITE); in userfaultfd_tests() 204 mprotect(mem + 6 * mem_size/8, mem_size/8, PROT_READ|PROT_WRITE); in userfaultfd_tests() 205 mprotect(mem + 7 * mem_size/8, mem_size/8, PROT_READ); in userfaultfd_tests() 255 mem = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in sanity_tests_sd() 399 m[0] = mmap(NULL, mem_size, PROT_READ | PROT_WRIT in sanity_tests_sd() [all...] |
H A D | mlock2-tests.c | 181 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in unlock_lock_check() 232 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in unlock_onfault_check() 259 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_mlock_onfault() 282 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_lock_onfault_of_present() 308 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_munlockall0() 351 map = mmap(NULL, 3 * page_size, PROT_READ | PROT_WRITE, in test_munlockall1() 435 map = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in test_mlockall()
|
H A D | pkey_sighandler_tests.c | 254 stack = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, in test_sigsegv_handler_with_different_pkey_for_stack() 264 pkey_mprotect(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); in test_sigsegv_handler_with_different_pkey_for_stack() 267 sigstack.ss_sp = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, in test_sigsegv_handler_with_different_pkey_for_stack() 410 stack = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, in test_pkru_sigreturn() 425 pkey_mprotect(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); in test_pkru_sigreturn() 428 sigstack.ss_sp = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, in test_pkru_sigreturn()
|
H A D | virtual_address_range.c | 89 ptr = mmap((void *) (1UL << 45), MAP_CHUNK_SIZE, PROT_READ | in validate_lower_address_hint() 169 ptr[i] = mmap(NULL, MAP_CHUNK_SIZE, PROT_READ | PROT_WRITE, 189 hptr[i] = mmap(hint, MAP_CHUNK_SIZE, PROT_READ | PROT_WRITE,
|
H A D | ksm_functional_tests.c | 176 map = mmap(NULL, size, PROT_READ|PROT_WRITE, in __mmap_and_merge_range() 265 map = mmap_and_merge_range(0xcf, size, PROT_READ | PROT_WRITE, KSM_MERGE_MADVISE); in test_unmerge() 303 map = mmap_and_merge_range(0x00, size, PROT_READ | PROT_WRITE, KSM_MERGE_MADVISE); in test_unmerge_zero_pages() 351 map = mmap_and_merge_range(0xcf, size, PROT_READ | PROT_WRITE, KSM_MERGE_MADVISE); in test_unmerge_discarded() 382 map = mmap_and_merge_range(0xcf, size, PROT_READ | PROT_WRITE, KSM_MERGE_MADVISE); in test_unmerge_uffd_wp() 486 map = __mmap_and_merge_range(0xcf, size, PROT_READ | PROT_WRITE, KSM_MERGE_NONE); in test_child_ksm() 609 map = mmap_and_merge_range(0xcf, size, PROT_READ | PROT_WRITE, KSM_MERGE_PRCTL); in test_prctl_unmerge()
|
H A D | hugetlb_madv_vs_map.c | 62 ptr = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, in map_extra() 99 huge_ptr = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, in main()
|
/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | mmap.c | 55 tmp1 = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, rdmap_fd, 0); in test_mmap() 61 tmp1 = mmap(NULL, page_size, PROT_READ, MAP_SHARED, rdmap_fd, 0); in test_mmap() 73 bss_mmaped = mmap(NULL, bss_sz, PROT_READ | PROT_WRITE, MAP_SHARED, in test_mmap() 81 map_mmaped = mmap(NULL, map_sz, PROT_READ | PROT_WRITE, MAP_SHARED, in test_mmap() 135 err = mprotect(map_mmaped, map_sz, PROT_READ); in test_mmap() 146 map_mmaped = mmap(NULL, map_sz, PROT_READ, MAP_SHARED, data_map_fd, 0); in test_mmap() 162 int flags = i % 2 ? PROT_READ : PROT_WRITE; in test_mmap() 180 tmp1 = mmap(NULL, map_sz, PROT_READ | PROT_WRITE, MAP_SHARED, in test_mmap() 200 tmp0 = mmap(NULL, 4 * page_size, PROT_READ, MAP_SHARED | MAP_ANONYMOUS, in test_mmap() 206 tmp1 = mmap(tmp0, 3 * page_size, PROT_READ, MAP_SHARED | MAP_FIXED, in test_mmap() [all …]
|
/linux/tools/testing/selftests/powerpc/mm/ |
H A D | exec_prot.c | 73 if (mprotect(insns, pgsize, PROT_READ | PROT_WRITE | PROT_EXEC)) { in segv_handler() 138 insns = (unsigned int *)mmap(NULL, pgsize, PROT_READ | PROT_WRITE, in test() 195 FAIL_IF(check_exec_fault(PROT_READ)); in test() 203 FAIL_IF(check_exec_fault(PROT_READ | PROT_WRITE)); in test() 211 FAIL_IF(check_exec_fault(PROT_READ | PROT_EXEC)); in test() 219 FAIL_IF(check_exec_fault(PROT_READ | PROT_WRITE | PROT_EXEC)); in test()
|
H A D | hugetlb_vs_thp_test.c | 18 p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, in test_body() 34 p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, in test_body()
|
/linux/tools/testing/selftests/mincore/ |
H A D | mincore_selftest.c | 50 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 94 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 149 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 231 addr = mmap(NULL, FILE_SIZE, PROT_READ | PROT_WRITE, in TEST() 330 addr = mmap(NULL, FILE_SIZE, PROT_READ | PROT_WRITE, in TEST()
|
/linux/tools/testing/selftests/ring-buffer/ |
H A D | map_test.c | 96 map = mmap(NULL, page_size, PROT_READ, MAP_SHARED, desc->cpu_fd, 0); in tracefs_cpu_map() 224 data = mmap(NULL, data_len, PROT_READ, MAP_SHARED, in TEST_F() 231 data = mmap(NULL, data_len, PROT_READ, MAP_SHARED, in TEST_F() 238 data = mmap(NULL, data_len, PROT_READ, MAP_SHARED, in TEST_F() 246 PROT_READ, MAP_SHARED, desc->cpu_fd, 0); in TEST_F()
|
/linux/tools/testing/selftests/sgx/ |
H A D | load.c | 63 bin = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in encl_map_bin() 204 ptr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); in encl_load() 273 seg->prot = PROT_READ | PROT_WRITE; in encl_load() 276 seg->prot = (phdr->p_flags & PF_R) ? PROT_READ : 0; in encl_load() 295 seg->src = mmap(NULL, heap_size, PROT_READ | PROT_WRITE, in encl_load() 297 seg->prot = PROT_READ | PROT_WRITE; in encl_load()
|
/linux/drivers/misc/lkdtm/ |
H A D | usercopy.c | 82 PROT_READ | PROT_WRITE | PROT_EXEC, in do_usercopy_stack() 150 PROT_READ | PROT_WRITE | PROT_EXEC, in do_usercopy_slab_size() 226 PROT_READ | PROT_WRITE | PROT_EXEC, in do_usercopy_slab_whitelist() 316 PROT_READ | PROT_WRITE | PROT_EXEC, in lkdtm_USERCOPY_KERNEL() 355 uaddr = vm_mmap(NULL, 0, PAGE_SIZE, PROT_READ | PROT_WRITE, in do_usercopy_page_span()
|
/linux/tools/testing/selftests/x86/ |
H A D | test_shadow_stack.c | 119 return mmap(addr, SS_SIZE, PROT_READ | PROT_WRITE, in create_normal_mem() 412 if (mprotect(shstk_ptr, SS_SIZE, PROT_READ) < 0) { in test_mprotect() 427 if (mprotect(shstk_ptr, SS_SIZE, PROT_READ) < 0) { in test_mprotect() 433 if (mprotect(shstk_ptr, SS_SIZE, PROT_WRITE | PROT_READ) < 0) { in test_mprotect() 565 free_area = mmap(0, SS_SIZE * 3, PROT_READ | PROT_WRITE, in test_guard_gap_other_gaps() 574 test_map = mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE, in test_guard_gap_other_gaps() 609 free_area = mmap(0, PAGE_SIZE * 4, PROT_READ | PROT_WRITE, in test_guard_gap_new_mappings_gaps() 614 shstk_start = mmap(free_area, PAGE_SIZE, PROT_READ | PROT_WRITE, in test_guard_gap_new_mappings_gaps() 707 sa32 = mmap(0, 4096, PROT_READ | PROT_WRITE, in test_32bit()
|
/linux/tools/testing/selftests/memfd/ |
H A D | memfd_test.c | 272 PROT_READ | PROT_WRITE, in mfd_assert_mmap_shared() 290 PROT_READ, in mfd_assert_mmap_private() 342 /* verify PROT_READ *is* allowed */ in mfd_assert_read() 345 PROT_READ, in mfd_assert_read() 358 PROT_READ | PROT_WRITE, in mfd_assert_read() 369 /* Test that PROT_READ + MAP_SHARED mappings work. */ 374 /* verify PROT_READ and MAP_SHARED *is* allowed */ in mfd_assert_read_shared() 377 PROT_READ, in mfd_assert_read_shared() 395 PROT_READ | PROT_WRITE, in mfd_assert_fork_private_write() 441 /* verify PROT_READ | PROT_WRIT in mfd_assert_write() [all...] |