Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Feb 24, 2011 7:15 pm 
Offline
Senior Newbie

Joined: Thu Feb 24, 2011 7:19 am
Posts: 18
I don't quite get what the problem is, I have added the following to fstab, running debian 6:

Code:
tmpfs  /dev/shm  tmpfs  defaults,nosuid,noexec,rw  0  0


And the options (mainly noexec) get applied if you remount /dev/shm.

But, and this is the odd bit, if I reboot my Linode, its like I havent even put the entry in, when you run mount. It just loads with default settings. If I remount, its fine.

Any help greatly appreciated.

Thanks.


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 5:05 am 
Offline
Senior Newbie

Joined: Thu Feb 24, 2011 7:19 am
Posts: 18
Basically, without anything in fstab, dev/shm loads with:

nsuid,nodev,rw

But I want it to load with:

noexec,nosuid,nodev,rw

But its like its being ignored in fstab at boot.

I cant even find a config file which tells /dev/shm to load with those defaulkt settings.


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 7:32 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Try this instead
Code:
/dev/shm   /dev/shm   tmpfs   noexec,nosuid,rw,nodev   0 0

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 10:17 am 
Offline
Senior Newbie

Joined: Thu Feb 24, 2011 7:19 am
Posts: 18
obs wrote:
Try this instead
Code:
/dev/shm   /dev/shm   tmpfs   noexec,nosuid,rw,nodev   0 0


Thanks, I'll give this a try when I get in later and let you know how I get on.


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 2:50 pm 
Offline
Senior Newbie

Joined: Thu Feb 24, 2011 7:19 am
Posts: 18
ok I now get this:

Code:
/dev/xvda on / type ext3 (rw,noatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 8:22 pm 
Offline
Senior Newbie

Joined: Thu Feb 24, 2011 7:19 am
Posts: 18
I did some digging through the innit scripts, and it seems that /dev/shm gets loaded by default before fstab is read, then after fstab is read, mtab is overwritten with defaults again.

So I have instead edited the defaults and mtab script so as to include noexec.

If anyone else has the same issue, Ill post up instructions


Top
   
PostPosted: Sat Jul 16, 2011 11:50 pm 
Offline
Newbie

Joined: Sat Jul 16, 2011 11:48 pm
Posts: 2
Website: http://www.maychu.net
Hello,
I have met the same issue as yours. Could you post your instructions?
I am on Debian 6 (amd64), KVM virtualisation.

I have digged into /etc/init.d/mtab.sh, and now I have done to correct it.

Code:
nano /etc/init.d/mtab.sh


change from
Code:
domtab tmpfs /dev/shm tmpfs -onosuid,nodev$SHM_OPT

into
Code:
domtab tmpfs /dev/shm tmpfs -onosuid,noexec,nodev$SHM_OPT


It works perfectly with Debian 6 amd64 / KVM box. I am not sure if it works on other systems/structures.

(Note that, I have edited $SHM_OPT in /etc/defaults/tmpfs, but it has not had affect after rebooting.)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group