From ef490722885a5c708c70dff656d094c7043ae081 Mon Sep 17 00:00:00 2001 From: Etienne CHAMPETIER Date: Thu, 8 Oct 2015 20:01:44 +0000 Subject: [PATCH] jail: Add MS_NODEV MS_NOEXEC MS_NOSUID mount options where needed this completes fafbf7338ec8304f2a0ec0ba76048fba2c01c07e Signed-off-by: Etienne CHAMPETIER --- jail/jail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jail/jail.c b/jail/jail.c index f459a5e..56dc9ca 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -193,11 +193,11 @@ static int build_jail_fs() rmdir("/old"); if (opts.procfs) { mkdir("/proc", 0755); - mount("proc", "/proc", "proc", MS_NOATIME, 0); + mount("proc", "/proc", "proc", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, 0); } if (opts.sysfs) { mkdir("/sys", 0755); - mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0); + mount("sysfs", "/sys", "sysfs", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, 0); } if (opts.ronly) mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0); -- 2.30.2