access the address outside the process space!

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi!

In Linux, is it possible for a process to access a buffer whose
starting address is out of the process's space? The process will
obtain the address from IPC. Will such memory access be prohibited by
Linux OS or the processor?
 
BRs, // Charlie

Re: access the address outside the process space!
Quoted text here. Click to load it

No, not in normal Linux. The whole reason of an OS with memory
protection is that this is not possible.

In ucLinux however, which does not use MMU (Memory Management Unit) of
the processor, you can overwrite/read every memory location in the
entire memory space.

Wumpus


Re: access the address outside the process space!

Quoted text here. Click to load it

Yes.  Have a look at mmap() function.


HTH,

  Vadim

Re: access the address outside the process space!
Quoted text here. Click to load it


Only if that other memory was acquired with the express option of
being shareable among processes.  Which, of course, is just another
variant of IPC in its own right, obliviating the need for passing
addresses around --- they would be different in separate processes, so
posting an address would be useless, anyway.

Quoted text here. Click to load it

By both working together: the processor offers the option to forbid
this, and the Linux kernel uses that option.
--
Hans-Bernhard Broeker ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Re: access the address outside the process space!
Thank all of you!

What I would like to do is to share some data ( of large size )
between multiple processes. One process will allocate the buffer and
fill it with the data. All the other processes access the buffer to
retrieve the data they need.

In embeded Linux, besides accessing the buffer by its address, is
there any better solution to share the data ( of large size ) in
different processes at run-time?

BRs, // Charlie

Re: access the address outside the process space!

Quoted text here. Click to load it

The canonical solution to that is either mmap() or shm_get(), and has
been pointed out to you before.  Care telling what's wrong with those
suggestions, for your application?

Quoted text here. Click to load it

Depending on what kind of "embedded Linux" you're talking about,
access by address may very well be strictly impossible to begin with.
It could also be the only option you have.  You really didn't give
enough information for others to help you on that one.
--
Hans-Bernhard Broeker ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Site Timeline