User: Password:
|
|
Subscribe / Log in / New account

Virtual Machines and Memory Protections

Virtual Machines and Memory Protections

Posted Nov 22, 2006 21:59 UTC (Wed) by cventers (guest, #31465)
In reply to: Virtual Machines and Memory Protections by bluefoxicy
Parent article: Virtual Machines and Memory Protections

Huh. Well, I was taking a guess, but I figured that the permissions you
supplied to shm_open() and mmap() would determine that.


(Log in to post comments)

Virtual Machines and Memory Protections

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 (guest, #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.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds