From: Felix Fietkau Date: Wed, 28 May 2025 14:24:54 +0000 (+0200) Subject: jail: add /dev/shm unconditionally X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=a3d6f1f59ff73cdb384ffde14049f841384968c9;p=project%2Fprocd.git jail: add /dev/shm unconditionally It is used by udebug, but might be used for other purposes as well Signed-off-by: Felix Fietkau --- diff --git a/jail/jail.c b/jail/jail.c index e7e4d6b..bd15b47 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -2982,6 +2982,7 @@ static void post_main(struct uloop_timeout *t) } /* default mounts */ add_mount(NULL, "/dev", "tmpfs", MS_NOATIME | MS_NOEXEC | MS_NOSUID, 0, "size=1M", -1); + add_mount("shm", "/dev/shm", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV, 0, "mode=1777", -1); add_mount(NULL, "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | MS_NOSUID, 0, "newinstance,ptmxmode=0666,mode=0620,gid=5", 0); if (opts.procfs || opts.ocibundle) { @@ -3012,9 +3013,6 @@ static void post_main(struct uloop_timeout *t) if (opts.sysfs || opts.ocibundle) add_mount("sysfs", "/sys", "sysfs", MS_RELATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RDONLY, 0, NULL, -1); - if (opts.ocibundle) - add_mount("shm", "/dev/shm", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV, 0, "mode=1777", -1); - } if (opts.setns.pid != -1) {