Skip to content

Commit 90c7bb4

Browse files
DilumAluthgestaticfloat
authored andcommitted
Bindmount /dev/zero into our root_dir
1 parent 3aa3647 commit 90c7bb4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deps/userns_sandbox.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,10 @@ static void mount_dev(const char * root_dir) {
354354
// Bindmount /dev/tty into our root_dir
355355
snprintf(path, sizeof(path), "%s/dev/tty", root_dir);
356356
bind_mount("/dev/tty", path, FALSE);
357+
358+
// Bindmount /dev/zero into our root_dir
359+
snprintf(path, sizeof(path), "%s/dev/zero", root_dir);
360+
bind_mount("/dev/zero", path, FALSE);
357361

358362
// If the host has a /dev/urandom, expose that to the sandboxed process as well.
359363
if (access("/dev/urandom", F_OK) == 0) {

0 commit comments

Comments
 (0)