by agwa · 13y ago · 0 comments
What? Citation needed. /dev/shm is simply a mount point for a memory-backed filesystem, much like /tmp. There's absolutely nothing special you can do with it.
The POSIX shared memory (i.e. shm_open) implementation on Linux does put its files in /dev/shm. By making /dev/shm read-only you're effectively disabling POSIX shared memory. Maybe some applications have vulnerabilities because they use POSIX shared memory unsafely? In that case you probably want to identify and upgrade those applications instead of disabling something system-wide that may cause legitimate programs to break.
I think it's better to protect the entry point (ie. in PHP, use php.ini open_basedir).
/tmp sometimes uses tmpfs which is also memory based, but not always and you won't know until you're in /tmp.