Posted Nov 23, 2006 19:27 UTC (Thu) by bluefoxicy (guest, #25366)
[Link]
Read the man page for shmget.
> mode_flags (least significant 9 bits) specifying the permissions granted to the owner, group, and world. These bits have the same format, and the same meaning, as the mode argument of open(2). Presently, the execute permissions are not used by the system.
I may be wrong about POSIX, but Linux disallows shared memory to be executable. Any attempt to use shared memory violating its permissions (i.e. mmap()ing it writable when the caller has only read-only perms) fails.
Yes, shared memory is complex and confusing as crap. Don't feel bad if you don't get it.
Virtual Machines and Memory Protections
Posted Nov 23, 2006 21:42 UTC (Thu) by cventers (subscriber, #31465)
[Link]
> Yes, shared memory is complex and confusing as crap. Don't feel bad if
> you don't get it.
Well, I think SysV shared memory is crap. POSIX shared memory is much
better. shm_open() says nothing about execute permissions in the manual
page. I haven't checked the kernel's implementation, but I thought that
might indicate that it does nothing special there.