2

I have a system which contains a process which allocates memory to other processes from its internal memory buffer , each process that needs memory allocation has to enroll with the allocating process and then get a pointer from it with the memory address which it can use for reading or writing or both (depends on process type).The requirement is to allow every enrolled process to access only the part of the allocating process memory buffer which was allocated to it and only with the given access rights. After some searching I found that there is an option to use shared memory objects and mmap for this implementation , are there other and safer ways to implement it?

2
  • Since it is possible to achieve what you describe with the suggested approach it is unclear what you mean with safer. Maybe you have additional security requirements you did not describe? May 29, 2018 at 19:15
  • What do you mean by having a process that allocates memory to other processes? Is it using shared memory? POSIX IPC? Does it literally allocate memory itself and then allow other processes to edit that memory via some file descriptor? Typically, only the kernel and libc will allocate memory (from physical memory and a heap pool, respectively), and only within a single process. One process cannot allocate memory on behalf of another process, it can only share memory in various ways.
    – forest
    May 30, 2018 at 4:16

0

Browse other questions tagged .