am 8e0e372a: Set PROT_EXEC on the whole pixelflinger code cache.
Merge commit '8e0e372a388434a0553810e2b958e59a26a6bd96' into gingerbread-plus-aosp * commit '8e0e372a388434a0553810e2b958e59a26a6bd96': Set PROT_EXEC on the whole pixelflinger code cache.
This commit is contained in:
commit
287a9585dc
1 changed files with 1 additions and 1 deletions
|
|
@ -94,7 +94,7 @@ void Assembly::ensureMbaseExecutable()
|
||||||
long pagemask = ~(pagesize - 1); // assumes pagesize is a power of 2
|
long pagemask = ~(pagesize - 1); // assumes pagesize is a power of 2
|
||||||
|
|
||||||
uint32_t* pageStart = (uint32_t*) (((uintptr_t) mBase) & pagemask);
|
uint32_t* pageStart = (uint32_t*) (((uintptr_t) mBase) & pagemask);
|
||||||
size_t adjustedLength = mBase - pageStart + mSize;
|
size_t adjustedLength = (mBase - pageStart) * sizeof(uint32_t) + mSize;
|
||||||
|
|
||||||
if (mBase && mprotect(pageStart, adjustedLength, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) {
|
if (mBase && mprotect(pageStart, adjustedLength, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) {
|
||||||
mspace_free(getMspace(), mBase);
|
mspace_free(getMspace(), mBase);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue