/linux/tools/testing/selftests/mm/ |
H A D | mseal_test.c | 183 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, mapflags, -1, 0); in setup_single_address_rw() 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() 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() 401 ret = sys_mprotect(ptr, 2 * page_size, PROT_READ | PROT_WRITE); in test_seal_split_end() 460 ret = sys_mprotect(ptr, 0, PROT_READ | PROT_WRITE); in test_seal_zero_length() 468 ret = sys_mprotect(ptr, size, PROT_READ | PROT_WRITE); in test_seal_zero_length() [all …]
|
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 | 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 | 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() 165 mprotect(map, pagesize, PROT_READ|PROT_WRITE); in test_mprotect()
|
H A D | madv_populate.c | 35 addr = mmap(0, pagesize, PROT_READ | PROT_WRITE, in sense_support() 79 addr = mmap(0, SIZE, PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); in test_prot_write() 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 | 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 | virtual_address_range.c | 90 PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 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 | pkey_sighandler_tests.c | 305 stack = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, in test_sigsegv_handler_with_different_pkey_for_stack() 318 pkey_mprotect(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); in test_sigsegv_handler_with_different_pkey_for_stack() 321 sigstack.ss_sp = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, in test_sigsegv_handler_with_different_pkey_for_stack() 473 stack = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, in test_pkru_sigreturn() 491 pkey_mprotect(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); in test_pkru_sigreturn() 494 sigstack.ss_sp = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, in test_pkru_sigreturn()
|
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() 200 mprotect(mem + 2 * mem_size/8, mem_size/8, PROT_READ|PROT_WRITE); 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() 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_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in sanity_tests_sd() 402 m[1] = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in sanity_tests_sd() 440 mem = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in sanity_tests_sd() 495 mem = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in sanity_tests_sd() [all …]
|
H A D | hmm-tests.c | 315 PROT_READ | PROT_WRITE, in TEST_F() 378 PROT_READ | PROT_WRITE, in TEST_F() 437 PROT_READ | PROT_WRITE, 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() 810 PROT_READ | PROT_WRITE, in TEST_F() 927 PROT_READ | PROT_WRITE, in TEST_F() 980 PROT_READ | PROT_WRITE, in TEST_F() [all …]
|
H A D | cow.c | 231 ret |= mprotect(mem, size, PROT_READ|PROT_WRITE); in do_test_cow_in_parent() 487 ret |= mprotect(mem, size, PROT_READ | PROT_WRITE); in do_test_iouring() 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() 852 ret = mprotect(mem + pagesize, pagesize, PROT_READ | PROT_WRITE); in do_run_with_thp() 1008 mem = mmap(NULL, hugetlbsize, PROT_READ | PROT_WRITE, flags, -1, 0); in run_with_hugetlb() 1021 dummy = mmap(NULL, hugetlbsize, PROT_READ | PROT_WRITE, flags, -1, 0); in run_with_hugetlb() 1242 ret = mprotect(mem + pagesize, pagesize, PROT_READ | PROT_WRITE); in do_test_anon_thp_collapse() 1477 mem = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, in run_with_zeropage() [all …]
|
H A D | mkdirty.c | 164 mem = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, in test_page_migration() 197 mem = mmap_thp_range(PROT_READ|PROT_WRITE, &mmap_mem, &mmap_size); in test_page_migration_thp() 236 mem = mmap_thp_range(PROT_READ|PROT_WRITE, &mmap_mem, &mmap_size); in test_pte_mapped_thp() 258 PROT_READ|PROT_WRITE)) { in test_pte_mapped_thp()
|
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()
|
H A D | migration.c | 131 ptr = mmap(NULL, TWOMEG, PROT_READ | PROT_WRITE, 157 ptr = mmap(NULL, TWOMEG, PROT_READ | PROT_WRITE, 191 ptr = mmap(NULL, 2*TWOMEG, PROT_READ | PROT_WRITE,
|
/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() 199 FAIL_IF(check_exec_fault(PROT_WRITE)); in test() 203 FAIL_IF(check_exec_fault(PROT_READ | PROT_WRITE)); in test() 215 FAIL_IF(check_exec_fault(PROT_WRITE | 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/bpf/prog_tests/ |
H A D | ringbuf.c | 108 mmap_ptr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, rb_fd, 0); in ringbuf_subtest() 165 mmap_ptr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, rb_fd, 0); in ringbuf_subtest() 174 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, page_size); in ringbuf_subtest() 180 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, 2 * page_size); in ringbuf_subtest() 184 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, 3 * page_size); in ringbuf_subtest() 186 mmap_ptr = mmap(NULL, 2 * page_size, PROT_WRITE, MAP_SHARED, rb_fd, 2 * page_size); in ringbuf_subtest() 194 ASSERT_ERR(mprotect(mmap_ptr, 4 * page_size, PROT_WRITE), "write_protect"); in ringbuf_subtest() 204 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_WRITE), "write_protect"); in ringbuf_subtest()
|
H A D | mmap.c | 55 tmp1 = mmap(NULL, page_size, PROT_READ | PROT_WRITE, 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() 152 err = mprotect(map_mmaped, map_sz, PROT_WRITE); 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()
|
/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/arch/um/os-Linux/ |
H A D | process.c | 63 prot = (r ? PROT_READ : 0) | (w ? PROT_WRITE : 0) | in os_map_memory() 75 int prot = ((r ? PROT_READ : 0) | (w ? PROT_WRITE : 0) | in os_protect_memory() 121 addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, in can_drop_memory()
|
/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() 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/powerpc/tm/ |
H A D | tm-signal-context-force-tm.c | 61 PROT_READ | PROT_WRITE, in usr_signal_handler() 127 ss.ss_sp = mmap(NULL, SIGSTKSZ, PROT_READ | PROT_WRITE, in tm_trap_test()
|
/linux/tools/testing/selftests/prctl/ |
H A D | set-anon-vma-name-test.c | 79 self->ptr_anon = mmap(NULL, AREA_SIZE, PROT_READ | PROT_WRITE, in FIXTURE_SETUP() 82 self->ptr_not_anon = mmap(NULL, AREA_SIZE, PROT_READ | PROT_WRITE, in FIXTURE_SETUP()
|