mprotect Questions
6
Solved
I want to write a signal handler to catch SIGSEGV.
I protect a block of memory for read or write using
char *buffer;
char *p;
char a;
int pagesize = 4096;
mprotect(buffer,pagesize,PROT_NONE)
T...
Ulrika asked 18/4, 2010 at 18:44
2
When two processes share a segment of memory opened with shm_open and then it gets mmap-ed, does doing an mprotect on a portion of the shared memory in one process affects the permissions seen by t...
3
I am writing a JIT on ARM Linux that executes an instruction set that contains self-modifying code. The instruction set does not have any cache flush instructions (similar to x86 in that respect).
...
Veery asked 6/5, 2010 at 0:50
1
This is essentially what I'm trying to do,
#include <sys/mman.h>
int zero() {
return 0;
}
int main(int argc, const char *argv[]) {
return mprotect((void *) &zero, 4096, PROT_READ | P...
Barbaresi asked 12/3, 2020 at 13:9
2
Solved
I am in a Linux kernel module, and I allocate some memory with, say, vmalloc(). I want to make the memory have read, write, and execute permission. What is the clean and appropriate way of doing th...
1
Solved
For the purpose of concurrent/parallel GC,
I'm interested in what memory order guarantee is provided by the mprotect syscall (i.e. the behavior of mprotect with multiple threads or the memory model...
Anthracnose asked 1/5, 2017 at 16:18
3
I'm trying to tweak the rules a little bit here, and malloc a buffer,
then copy a function to the buffer.
Calling the buffered function works, but the function throws a Segmentation fault when i'm...
2
Solved
On Linux (or Solaris) is there a better way than hand parsing /proc/self/maps repeatedly to figure out whether or not you can read, write or execute whatever is stored at one or more addresses in m...
Schizothymia asked 6/11, 2008 at 16:26
2
Solved
I'm confused, does mmap allocate an entire page of memory (regardless of size specified), or does it just allocate the size you request? Really, I'm curious about what happens on subsequent calls t...
2
Solved
I've been trying to use mprotect against reading first, and then writing.
Is here my code
#include <sys/types.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h&g...
1
Solved
I've recently been working on detouring functions (only in Linux) and so far I've had great success. I was developing my own detouring class until I found this. I modernized the code a bit and conv...
3
Solved
I'm trying to call inlined machine code from pure Python code on Linux. To this end, I embed the code in a bytes literal
code = b"\x55\x89\xe5\x5d\xc3"
and then call mprotect() via ctypes to all...
1
I have a problem with my iPhone application developed with MonoTouch.
I am developing an application that contacts a WCF Service, and when the WCF Service answer back, I update an UITableView with ...
Lasky asked 28/12, 2010 at 10:35
1
Solved
According to the Linux man page for mprotect the function has 3 arguments:
int mprotect(const void *addr, size_t len, int prot);
but while running ltrace on a program that I'm analyzing I see that...
1
© 2022 - 2024 — McMap. All rights reserved.