Neutered devices in jails (per FS flag?)

Jan Bramkamp crest at rlwinm.de
Wed Sep 16 16:57:01 UTC 2015



On 16/09/15 18:30, Kevin Day wrote:
> We’re currently using jails to allow servers to copy backups of themselves to a central backup server. The problem we’re having is with mknod/devices. Currently jails don’t allow device files to be created, which makes sense - you don’t want them to be able to bypass the jail by opening /dev/kmem or something. We want jails to be able to create device files, just not be able to open/use them.
>
> Has anyone given any thought to changing this behavior? Allowing jails to create/manipulate device files, but not actually opening them? I.e. instead of returning EPERM on creating the device, instead return EPERM on opening it? This would likely need to be a filesystem flag, because jails still require some devices to work (a separate devfs mount or something). We could make the jail’s /dev read only or use devfs so those devices still work, but have the parent jail directory with a “noopendev” flag or something similar.
>
> Has anyone gone down this path before?

There is no reason to backup device files on FreeBSD because FreeBSD 
uses a dynamic devfs. Backup the devfs rules and devfs.conf instead of 
the device files.


More information about the freebsd-fs mailing list