diff --git a/src/firejail/fs.c b/src/firejail/fs.c index 98efb5e4154..08b268d93ab 100644 --- a/src/firejail/fs.c +++ b/src/firejail/fs.c @@ -571,8 +571,11 @@ void fs_proc_sys_dev_boot(void) { /* Mount a version of /sys that describes the network namespace */ if (arg_debug) printf("Remounting /sys directory\n"); - if (umount2("/sys", MNT_DETACH) < 0) - fwarning("failed to unmount /sys\n"); + // if this is an overlay, just mount a new /sys on top of the upper layer + if (!arg_overlay) { + if (umount2("/sys", MNT_DETACH) < 0) + fwarning("failed to unmount /sys\n"); + } if (mount("sysfs", "/sys", "sysfs", MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REC, NULL) < 0) fwarning("failed to mount /sys\n"); else