[Pkg-sysvinit-devel] Bug#378182: mount -o nosuid,nodev /dev/shm

dean gaudet dean at arctic.org
Thu Aug 3 01:15:08 UTC 2006


On Thu, 3 Aug 2006, Petter Reinholdtsen wrote:

> [Dean Gaudet]
> > /dev/shm should be mounted -o nosuid,nodev ... there's no reason to
> > allow suid binaries or devices in /dev/shm.
> 
> If I understand you correctly, you are proposing the change in the
> patch I attach here.  I'm not sure what the consequences would be,
> though I agree that the "normal" /dev/shm/ should work with both
> nosuid and nodev options enabled.  This bug report is a variation of
> bug #378280, where a similar request is made for /proc/ and /sys/.
> There, -o noexec,nodev,nosuid is proposed.  Is there any reason why
> /dev/shm/ should allow executables?

i think the only way to get PROT_EXEC on a posix shm segment is to use 
mprotect... i'm just not sure anything actually does that.

i've been running a busy amd64 unstable box with a patch like the one you 
suggest for 10 days now and haven't yet run into anything which is unhappy 
with noexec.  but who knows what's out there.

# grep shm /proc/mounts
tmpfs /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0

i think because shm_open itself makes no mention of being able to support 
executable shared memory i'd say we should put noexec on /dev/shm.

-dean




More information about the Pkg-sysvinit-devel mailing list