[LEDE-DEV] [PATCH procd] ujail: add basic /dev files

Etienne CHAMPETIER champetier.etienne at gmail.com
Thu Dec 29 18:08:58 PST 2016


This adds
/dev/full
/dev/null
/dev/urandom
/dev/zero
in every jail (not having them only allow subtle bugs)

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/jail.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/jail/jail.c b/jail/jail.c
index 834d677..8e7cddc 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -398,6 +398,11 @@ int main(int argc, char **argv)
 
 	uloop_init();
 	if (opts.namespace) {
+		add_mount("/dev/full", 0, -1);
+		add_mount("/dev/null", 0, -1);
+		add_mount("/dev/urandom", 0, -1);
+		add_mount("/dev/zero", 0, -1);
+
 		int flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | SIGCHLD;
 		if (opts.hostname)
 			flags |= CLONE_NEWUTS;
-- 
2.7.4




More information about the Lede-dev mailing list