Skip to contentSkip to conversation

skeleton: make /run a proper directory/filesystem

PATCH New Gustavo Zacarias 3 participants 3 messages Nov 27, 2014 – Feb 3, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 skeleton: make /run a proper directory/filesystem

Making /var/run and /run symlinks to /tmp is bad since the underlying tmpfs filesystem is mode 1777 which leads to possible security attack vectors via badly owned/mask-mode pidfiles and state files residing there.

So make /run a proper directory with /var/run symlinked to it. Eventually all startup scripts and state info should be pointed to /run directly as per the linux fhs and good practice.

Add a tmpfs filesystem entry for /run so that busybox inittab, systemv inittab and systemd automount mounts it there to avoid breaking the system.

While at it fix inconsistent spacing in /etc/fstab by using tabs and drop the "static file system information" header whatever that means.

---
 system/skeleton/etc/fstab  | 17 ++++++++---------
 system/skeleton/run        |  1 -
 system/skeleton/run/.empty |  0
 system/skeleton/var/run    |  2 +-
 4 files changed, 9 insertions(+), 11 deletions(-)
 delete mode 120000 system/skeleton/run
 create mode 100644 system/skeleton/run/.empty
system/skeleton/etc/fstab +8 -9
index e000aad..2b418a0 100644
@@ -1,9 +1,8 @@
-# /etc/fstab: static file system information.
-#
-# <file system> <mount pt>     <type>	<options>         <dump> <pass>
-/dev/root       /              ext2	rw,noauto         0      1
-proc		/proc	       proc     defaults	  0	 0
-devpts		/dev/pts       devpts   defaults,gid=5,mode=620	  0	 0
-tmpfs           /dev/shm       tmpfs    mode=0777         0      0
-tmpfs           /tmp           tmpfs    mode=1777         0      0
-sysfs		/sys	       sysfs    defaults	  0	 0
+# <file system>	<mount pt>	<type>	<options>	<dump>	<pass>
+/dev/root	/		ext2	rw,noauto	0	1
+proc		/proc		proc	defaults	0	0
+devpts		/dev/pts	devpts	defaults,gid=5,mode=620	0	0
+tmpfs		/dev/shm	tmpfs	mode=0777	0	0
+tmpfs		/tmp		tmpfs	mode=1777	0	0
+tmpfs		/run		tmpfs	mode=0755,nosuid,nodev	0	0
+sysfs		/sys		sysfs	defaults	0	0
system/skeleton/run deleted +0 -1
deleted file mode 120000
index 1c2f433..0000000
@@ -1 +0,0 @@
-tmp
\ No newline at end of file
system/skeleton/run/.empty new file +0 -0
new file mode 100644
index 0000000..e69de29
system/skeleton/var/run +1 -1
index 1431b0e..84ba55b 120000
@@ -1 +1 @@
-../tmp
\ No newline at end of file
+../run
\ No newline at end of file
Signature · 1 line
2.0.4
#1 lore raw

PATCH 1/1 skeleton: make /run a proper directory/filesystem

Dear Gustavo Zacarias,

Quoted 8 lines · Gustavo Zacarias

Making /var/run and /run symlinks to /tmp is bad since the underlying tmpfs filesystem is mode 1777 which leads to possible security attack vectors via badly owned/mask-mode pidfiles and state files residing there.

So make /run a proper directory with /var/run symlinked to it. Eventually all startup scripts and state info should be pointed to /run directly as per the linux fhs and good practice.

Quoted 8 lines

Add a tmpfs filesystem entry for /run so that busybox inittab, systemv inittab and systemd automount mounts it there to avoid breaking the system.

While at it fix inconsistent spacing in /etc/fstab by using tabs and drop the "static file system information" header whatever that means.

Applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 skeleton: make /run a proper directory/filesystem

Thomas,

Quoted 15 lines · Thomas Petazzoni

Dear Gustavo Zacarias,

Quoted 12 lines · Gustavo Zacarias

Making /var/run and /run symlinks to /tmp is bad since the underlying tmpfs filesystem is mode 1777 which leads to possible security attack vectors via badly owned/mask-mode pidfiles and state files residing there.

So make /run a proper directory with /var/run symlinked to it. Eventually all startup scripts and state info should be pointed to /run directly as per the linux fhs and good practice.

Add a tmpfs filesystem entry for /run so that busybox inittab, systemv inittab and systemd automount mounts it there to avoid breaking the system.

Quoted 6 lines
Quoted 4 lines

While at it fix inconsistent spacing in /etc/fstab by using tabs and drop the "static file system information" header whatever that means.

Applied, thanks!

When I pulled, I got a broken symlink, to 'run?' instead of 'run'. Is yours okay?

$ ls -al system/skeleton/var/run
lrwxrwxrwx 1 dano dano 7 Feb  3 11:00 system/skeleton/var/run -> ../run?

Danomi -

Quoted 10 lines

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot