Home
last modified time | relevance | path

Searched refs:PROT_READ (Results 1 – 25 of 83) sorted by relevance

1234

/system/core/libcutils/
Dashmem_test.cpp71 ASSERT_NO_FATAL_FAILURE(TestCreateRegion(size, fd, PROT_READ | PROT_WRITE)); in TEST()
74 ASSERT_NO_FATAL_FAILURE(TestMmap(fd, size, PROT_READ | PROT_WRITE, &region1)); in TEST()
82 ASSERT_NO_FATAL_FAILURE(TestMmap(fd, size, PROT_READ, &region2)); in TEST()
93 ASSERT_NO_FATAL_FAILURE(TestCreateRegion(size, fd, PROT_READ | PROT_WRITE)); in TEST()
96 ASSERT_NO_FATAL_FAILURE(TestMmap(fd, size, PROT_READ | PROT_WRITE, &region1)); in TEST()
107 void* region2 = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in TEST()
122 ASSERT_NO_FATAL_FAILURE(TestMmap(fd, size, PROT_READ | PROT_WRITE, &region2)); in TEST()
135 ASSERT_NO_FATAL_FAILURE(TestCreateRegion(size, fd, PROT_READ | PROT_WRITE)); in TEST()
136 ASSERT_NO_FATAL_FAILURE(TestMmap(fd, dataSize, PROT_READ | PROT_WRITE, &region, holeSize)); in TEST()
190 ASSERT_NO_FATAL_FAILURE(TestCreateRegion(size, fd, PROT_READ)); in TEST()
[all …]
/system/media/audio_utils/tests/
Dfifo_multiprocess.cpp50 sizeof(audio_utils_fifo_index), PROT_READ | PROT_WRITE, MAP_SHARED, frontFd, (off_t) 0); in main()
55 sizeof(audio_utils_fifo_index), PROT_READ | PROT_WRITE, MAP_SHARED, rearFd, (off_t) 0); in main()
59 int16_t *data = (int16_t *) mmap(NULL, sizeof(audio_utils_fifo_index), PROT_READ | PROT_WRITE, in main()
79 ok = ashmem_set_prot_region(frontFd, PROT_READ); in main()
83 sizeof(audio_utils_fifo_index), PROT_READ, MAP_SHARED | MAP_FIXED, frontFd, in main()
142 ok = ashmem_set_prot_region(rearFd, PROT_READ); in main()
146 sizeof(audio_utils_fifo_index), PROT_READ, MAP_SHARED | MAP_FIXED, rearFd, in main()
153 ok = ashmem_set_prot_region(dataFd, PROT_READ); in main()
156 data = (int16_t *) mmap((char *) data + pageSize * 8, BUFFER_SIZE, PROT_READ, in main()
/system/core/debuggerd/seccomp_policy/
Dcrash_dump.policy.def40 Define the values of PROT_READ and PROT_WRITE ourselves to maintain backwards compatibility.
42 #define PROT_READ 0x1
47 mprotect: arg2 in PROT_READ|PROT_WRITE
53 mmap: arg2 in PROT_READ|PROT_WRITE
57 mmap2: arg2 in PROT_READ|PROT_WRITE
/system/core/libion/tests/
Dinvalid_values_test.cpp121 int ret = ion_map(0, m_validHandle, 4096, PROT_READ, 0, 0, &ptr, &map_fd); in TEST_F()
124 EXPECT_EQ(-EBADF, ion_map(-1, m_validHandle, 4096, PROT_READ, 0, 0, &ptr, &map_fd)); in TEST_F()
126 EXPECT_EQ(-EINVAL, ion_map(m_ionFd, 0, 4096, PROT_READ, 0, 0, &ptr, &map_fd)); in TEST_F()
128 EXPECT_EQ(-EINVAL, ion_map(m_ionFd, m_badHandle, 4096, PROT_READ, 0, 0, &ptr, &map_fd)); in TEST_F()
130 EXPECT_EQ(-EINVAL, ion_map(m_ionFd, m_validHandle, 0, PROT_READ, 0, 0, &ptr, &map_fd)); in TEST_F()
134 EXPECT_EQ(-EINVAL, ion_map(m_ionFd, m_validHandle, 4096, PROT_READ, 0, -1, &ptr, &map_fd)); in TEST_F()
136 EXPECT_EQ(-EINVAL, ion_map(m_ionFd, m_validHandle, 4096, PROT_READ, 0, 0, NULL, &map_fd)); in TEST_F()
138 EXPECT_EQ(-EINVAL, ion_map(m_ionFd, m_validHandle, 4096, PROT_READ, 0, 0, &ptr, NULL)); in TEST_F()
Dmap_test.cpp42 …ASSERT_EQ(0, ion_map(m_ionFd, handle, size, PROT_READ | PROT_WRITE, MAP_SHARED, 0, &ptr, &map_fd)); in TEST_F()
70 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
92 … ptr = (unsigned char *)mmap(NULL, PAGE_SIZE * 2, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
100 …ptr = (unsigned char *)mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, PAGE_SIZE… in TEST_F()
126 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
152 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
Dexit_test.cpp102 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
125 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
149 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
172 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
196 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
219 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
Ddevice_test.cpp149 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
184 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
213 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
246 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
275 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
310 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
339 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
374 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
404 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
439 ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F()
[all …]
Dformerly_valid_handle_test.cpp55 ASSERT_EQ(-EINVAL, ion_map(m_ionFd, m_handle, 4096, PROT_READ, 0, 0, &ptr, &map_fd)); in TEST_F()
/system/core/libunwindstack/tests/
DMapInfoGetElfTest.cpp71 MapInfo info(nullptr, 0x1000, 0x2000, 0, PROT_READ, ""); in TEST_F()
80 MapInfo info(nullptr, 0x3000, 0x4000, 0, PROT_READ, ""); in TEST_F()
100 MapInfo info(nullptr, 0x8000, 0x9000, 0, PROT_READ, ""); in TEST_F()
114 MapInfo info(nullptr, 0x3000, 0x4000, 0, PROT_READ, ""); in TEST_F()
126 MapInfo info(nullptr, 0x2000, 0x3000, 0, PROT_READ, ""); in TEST_F()
142 MapInfo info(nullptr, 0x5000, 0x8000, 0, PROT_READ, ""); in TEST_F()
158 MapInfo info(nullptr, 0x1000, 0x1000, 0, PROT_READ, elf_.path); in TEST_F()
185 MapInfo info(nullptr, 0x1000, 0x2000, 0x100, PROT_READ, elf_.path); in TEST_F()
214 MapInfo info(nullptr, 0x1000, 0x2000, 0x2000, PROT_READ, elf_.path); in TEST_F()
244 MapInfo info(nullptr, 0x5000, 0x6000, 0x1000, PROT_READ, elf_.path); in TEST_F()
[all …]
DMapsTest.cpp49 maps.Add(0x1000, 0x2000, 0, PROT_READ, "fake_map", 0); in TEST()
58 ASSERT_EQ(PROT_READ, info->flags); in TEST()
67 maps.Add(0x1000, 0x2000, 0, PROT_READ, "fake_map", 0); in TEST()
78 ASSERT_EQ(PROT_READ, info->flags); in TEST()
90 EXPECT_EQ(PROT_READ | PROT_WRITE | PROT_EXEC, info.flags); in TEST()
104 EXPECT_EQ(PROT_READ | PROT_WRITE | PROT_EXEC, info.flags); in TEST()
163 EXPECT_EQ(PROT_READ | PROT_WRITE | PROT_EXEC, info.flags); in TEST()
169 EXPECT_EQ(PROT_READ | PROT_WRITE | PROT_EXEC, info.flags); in TEST()
195 EXPECT_EQ(PROT_READ, info->flags); in TEST()
219 EXPECT_EQ(PROT_READ | PROT_WRITE | PROT_EXEC, info->flags); in TEST()
[all …]
DUnwinderTest.cpp64 AddMapInfo(0x1000, 0x8000, 0, PROT_READ | PROT_WRITE, "/system/fake/libc.so", elf); in SetUpTestCase()
66 AddMapInfo(0x10000, 0x12000, 0, PROT_READ | PROT_WRITE, "[stack]"); in SetUpTestCase()
68 AddMapInfo(0x13000, 0x15000, 0, PROT_READ | PROT_WRITE | MAPS_FLAGS_DEVICE_MAP, in SetUpTestCase()
73 AddMapInfo(0x20000, 0x22000, 0, PROT_READ | PROT_WRITE, "/system/fake/libunwind.so", elf); in SetUpTestCase()
77 AddMapInfo(0x23000, 0x24000, 0, PROT_READ | PROT_WRITE, "/fake/libanother.so", elf); in SetUpTestCase()
81 AddMapInfo(0x33000, 0x34000, 0, PROT_READ | PROT_WRITE, "/fake/compressed.so", elf); in SetUpTestCase()
87 AddMapInfo(0x43000, 0x44000, 0x1d000, PROT_READ | PROT_WRITE, "/fake/fake.apk", elf); in SetUpTestCase()
92 AddMapInfo(0x53000, 0x54000, 0, PROT_READ | PROT_WRITE, "/fake/fake.oat"); in SetUpTestCase()
94 AddMapInfo(0xa3000, 0xa4000, 0, PROT_READ | PROT_WRITE | PROT_EXEC, "/fake/fake.vdex"); in SetUpTestCase()
101 AddMapInfo(0xa5000, 0xa6000, 0, PROT_READ | PROT_WRITE | PROT_EXEC, "/fake/fake_load_bias.so", in SetUpTestCase()
[all …]
DMapInfoCreateMemoryTest.cpp162 prev_info.flags = PROT_READ; in TEST_F()
259 MapInfo info(nullptr, 0x2000, 0x3000, 0, PROT_READ, ""); in TEST_F()
290 maps.Add(0x500, 0x600, 0, PROT_READ, "something_else", 0); in TEST_F()
291 maps.Add(0x1000, 0x2600, 0, PROT_READ, "/only/in/memory.so", 0); in TEST_F()
292 maps.Add(0x3000, 0x5000, 0x4000, PROT_READ | PROT_EXEC, "/only/in/memory.so", 0); in TEST_F()
330 maps.Add(0x500, 0x600, 0, PROT_READ, "something_else", 0); in TEST_F()
331 maps.Add(0x1000, 0x2000, 0, PROT_READ, "/only/in/memory.apk", 0); in TEST_F()
332 maps.Add(0x2000, 0x3000, 0x1000, PROT_READ | PROT_EXEC, "/only/in/memory.apk", 0); in TEST_F()
333 maps.Add(0x3000, 0x4000, 0xa000, PROT_READ, "/only/in/memory.apk", 0); in TEST_F()
334 maps.Add(0x4000, 0x5000, 0xb000, PROT_READ | PROT_EXEC, "/only/in/memory.apk", 0); in TEST_F()
[all …]
DMemoryRemoteTest.cpp113 mmap(nullptr, 4 * getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)); in TEST_F()
157 void* src = mmap(nullptr, pagesize * 2, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE,-1, 0); in TEST_F()
238 mmap(nullptr, 3 * getpagesize(), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in TEST_F()
271 mmap(nullptr, 3 * getpagesize(), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in TEST_F()
307 mmap(nullptr, 2 * getpagesize(), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in TEST_F()
DMemoryLocalTest.cpp73 mmap(nullptr, 2 * getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)); in TEST()
94 mmap(nullptr, 3 * 4096, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in TEST()
DMapInfoGetLoadBiasTest.cpp53 map_info_.reset(new MapInfo(nullptr, 0x1000, 0x20000, 0, PROT_READ | PROT_WRITE, "")); in SetUp()
66 MapInfo info(nullptr, 0x1000, 0x2000, 0, PROT_READ, ""); in TEST_F()
/system/core/libunwindstack/
DGlobal.cpp84 (info->flags & (PROT_READ | PROT_WRITE)) == (PROT_READ | PROT_WRITE)) { in FindAndReadVariable()
97 if (map_start == nullptr && (info->flags & PROT_READ) && info->offset == 0 && in FindAndReadVariable()
/system/core/base/
Dmapped_file_test.cpp34 auto m = android::base::MappedFile::FromFd(tf.fd, 3, 2, PROT_READ); in TEST()
46 auto m = android::base::MappedFile::FromFd(tf.fd, 4096, 0, PROT_READ); in TEST()
/system/core/libprocinfo/
Dprocess_map_test.cpp35 ASSERT_EQ(maps[0].flags, PROT_READ | PROT_WRITE); in TEST()
41 ASSERT_EQ(maps[876].flags, PROT_READ | PROT_EXEC); in TEST()
47 ASSERT_EQ(maps[1260].flags, PROT_READ); in TEST()
/system/core/debuggerd/libdebuggerd/test/
Dtombstone_test.cpp111 unwinder_mock_->MockAddMap(build_id_offset, 0x123456789abdf000UL, 0, PROT_READ, in TEST_F()
115 unwinder_mock_->MockAddMap(0x1234000, 0x1235000, 0, PROT_READ, "/system/lib/libfake.so", 0); in TEST_F()
149 unwinder_mock_->MockAddMap(0xa334000, 0xa335000, 0xf000, PROT_READ, "", 0); in TEST_F()
152 unwinder_mock_->MockAddMap(0xa634000, 0xa635000, 0, PROT_READ | PROT_WRITE | PROT_EXEC, in TEST_F()
187 unwinder_mock_->MockAddMap(0xa634000, 0xa635000, 0, PROT_READ | PROT_WRITE | PROT_EXEC, in TEST_F()
220 unwinder_mock_->MockAddMap(0xa634000, 0xa635000, 0, PROT_READ | PROT_WRITE | PROT_EXEC, in TEST_F()
253 unwinder_mock_->MockAddMap(0xa634000, 0xa635000, 0, PROT_READ | PROT_WRITE | PROT_EXEC, in TEST_F()
284 unwinder_mock_->MockAddMap(0xa634000, 0xa635000, 0, PROT_READ | PROT_WRITE | PROT_EXEC, in TEST_F()
/system/core/libbacktrace/
DBacktracePtrace.cpp56 if (!BacktraceMap::IsValid(map) || !(map.flags & PROT_READ)) { in ReadWord()
71 if (!BacktraceMap::IsValid(map) || !(map.flags & PROT_READ)) { in Read()
/system/bt/osi/test/
Dwakelock_test.cc104 mmap(nullptr, lock_stat.st_size, PROT_READ, MAP_PRIVATE, lock_fd, 0); in IsFileWakeLockAcquired()
106 void* unlock_file = mmap(nullptr, unlock_stat.st_size, PROT_READ, in IsFileWakeLockAcquired()
/system/extras/kexec_tools/
Dkexecload.c133 … atag_buffer = (char *) mmap(NULL, atag_size, PROT_READ, MAP_POPULATE | MAP_PRIVATE, atag_file, 0); in main()
134 …zimage_buffer = (char *) mmap(NULL, zimage_size, PROT_READ, MAP_POPULATE | MAP_PRIVATE, zimage_fil… in main()
/system/libhidl/transport/memory/1.0/default/
DAshmemMapper.cpp49 void* data = mmap(0, mem.size(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); in mapMemory()
/system/core/base/include/android-base/
Dmapped_file.h28 #define PROT_READ 1 macro
/system/core/libbacktrace/include/backtrace/
DBacktraceMap.h25 #define PROT_READ 0x1 macro
137 bool IsReadable(uint64_t pc) { return GetFlags(pc) & PROT_READ; } in IsReadable()

1234