1

0

I have the following line in my /etc/fstab on three of my slackware servers:

tmpfs /dev/shm tmpfs rw,nodev,nosuid,noexec 0 0 

All three show the mount options correctly in /proc/mounts:

tmpfs /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0 

Two of them show the correct options with the mount command:

tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec) 

The third one shows different options with the mount command:

tmpfs on /dev/shm type tmpfs (rw) 

The only difference is the third one is at runlevel 4 while the other two are at runlevel 3. Any ideas on why the third one is showing two different mount options and which one is the correct one?

5
  • Is /etc/mtab a regular file (that would be updated by the mount command) or a symlink to /proc/mounts? Commented Sep 30, 2021 at 20:10
  • /etc/mtab is a regular file that is updated with the mount command. It is correctly shown if I manually mount it with: "mount -o remount,rw,nodev,nosuid,noexec" Commented Sep 30, 2021 at 20:28
  • What would grep shm /proc/*/mountinfo | sort -ut: -k2,2 print on that machine? Btw, you should leave /dev/shm alone. If you mount it noexec, you break shm_open(3) for zero benefit. Commented Sep 30, 2021 at 20:35
  • @uncle /proc/1/mountinfo:22 17 0:18 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw. The noexec was a finding from Tenable's CIS Linux Server Policy. Commented Sep 30, 2021 at 20:51
  • 2
    Please do not cross-post. For the record: the other copy is on Super User. Commented Sep 30, 2021 at 21:38

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.