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.etie...@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


_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to