-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utilize the 'zoned' property in Linux #3159
Comments
But it's still possible for a 'normal' user to both list and cd into the directory:
|
Once again Linux finds itself in the situation where there isn't a single integrated piece of software for a feature. Containers are made by leveraging several features in tandem by what is effectively third party software. SMB and iSCSI sharing are in much the same boat (even though Samba is the defacto). As far as the kernel is concerns containers are made on demand and mount namespaces are identified only by inode number (see /proc/self/ns/mnt on a sufficiently up-to-date kernel - the latest CentOS 6 is adequate). From the man page and documentation it appears that from a Linux standpoint the behaviour would simply be, loosely, extern struct mount_namespace *root_mnt; int on_mount_filesystem(struct zfs_dataset *databset) { if (dataset->property_zoned == B_TRUE && current->mnt_ns != root_mnt) { return -EPERM; } else { // Do allow mount return 0; } } ...which has the disadvantage that it doesn't specify WHICH zones allow mounting. Furthermore under Linux it's typical that containers are restricted to mounting 'safe' filesystems (such as tmpfs, proc and sysfs) which may render this obsolete anyway. |
Digging through the code (and comparing with the illumos code), I noticed that ZoL is always in a global zone. This because
where as illumos does a sys call in
This does not seem portable, but on the other hand, I've been unable to figure ot exactly what the |
It also seems like the
In illumos this is defined in
None of the secpolicy_*() functions is implemented in ZoL at the moment. The're all defined as |
Trying out the secpolicy branches (https://github.com/maxximino/spl/tree/secpolicy and https://github.com/maxximino/zfs/tree/secpolicy) did (of course, in retrospect) not help because of Anyone have an idea on how to create one that can detect global/local zone (without using the SYS_zone syscall that doesn't exist in Linux anyway)? |
|
@FransUrbo I think you've hit on most of they key issues here, let me just try and add a little more context. Basically the zone functionality for ZoL was never implemented because Linux doesn't provide a single direct analog for it. Instead as @DeHackEd mentioned there are a variety of solutions with differing functionality. At the time the most compatible and straight forward thing to do was to disable it entirely and place everything in the global zone. We could then revisit this issue another day. If today is that day then let's take a step back and decide what problem we're trying to solve. Is it just a feeling that the I think one big step in getting there would be to focus on finalizing the work in #434. Adding support for |
Since I don't know exactly what |
docker is similar lk On 3/9/15 3:03 PM, Kash Pande (Jentu) wrote:
Linda Kateley |
Rights delegation is probably the keystone to all of this, as @behlendorf seems to be saying. Far as the concepts of jails/zones/containers, i'd say that LXC based namespacing seems most consistent with Solaris Zones, and should probably be the target implementation for the property @ present. However, LXC is a moving target (doing the sniper dance while having seizures), so we may have to maintain ongoing changes to make this work. Far as the discrepancy between different container implementations, this looks reminiscent of the iSCSI work @FransUrbo so graciously maintained for so long, in that we're attempting to target multiple Linux userspace and kernel functions which do the same thing. Maybe this is where we start making a case for lib/zfs/linuxmonkeys to keep monkey patched wrappers for all the varied implementations of what the "Do it Right" folks built monolithically into Solaris kernel prior to its fall from grace. Zones, sharing mechanisms, and cryptographic components jump out as things which would probably not be so tightly integrated with ZFS if the original development work was targeted at cross-platform implementation. I've no clue if we can, or even should try to, convince Illumos to decouple storage from services, but barking up that tree with Oracle is not even worth discussing. Anyone have a taste for punishment, or actually know how many service hooks we have in the code today? If OpenZFS (basically Illumos/Delphix and whoever lurks the BSD world) were to agree to push these into a separate layer which we maintain on a per-OS basis, it would make all of this portability much easier, and with consistent rules for how said shims are written, portability of function should be much simpler than full rewrites in the monolithic codebase we see today (again, look @ shareiscsi as an example of how this gets real hard, real fast). For example, we could use this approach to split the known requirements of any future crypto implementation into services and storage - with ZFS holding the cryptographic algos themselves (to ensure bit-level consistency between platforms) and ZIO pipeline code to actually encrypt, while key management and all the associated rigmarole is handled by the individual crypto APIs of each OS. |
They simply live in the eighties, with their 'one branch for everything, and
Granted, it was a humongous mess in the beginning (because I didn't really |
The issue get's somewhat more complicated once we've implemented 'this' (either the |
Because the |
These are the SPL-side changes right now: https://github.com/mistifyio/spl/tree/datasetns |
@trisk |
I don't know if that's what the original poster meant, but I can confirm that it's technically possible, in LXD with the yet-to-be-released ZFS 2.2, to use this |
FYI, I have created a feature request for proper support in LXD at https://github.com/lxc/lxd/issues/11796. |
I've revitalized an idea I had about a year ago (or there about :) - I'm sure I had a discussion with @behlendorf about this, but I can't find that discussion...
I think the basic idea was to use "lightweight VMs" (i.e. "Linux Containers") for this. But trying to understand the
zoned
property is somewhat difficult, since I haven't used Solaris in years (and the *BSDjails
is basically chroots from what I've understand when using them).Creating a filesystem with
zoned=on
doesn't mount the filesystem automatically, nor can it be mounted:On IRC, I was told that on Solaris, the container (or the Solaris equivalent) needs to do all the work.
But hack every container software on Linux (and apparently there's a few: https://linuxcontainers.org/) isn't an option!
I haven't used Linux containers in years (ever since I realized they where a little to lightweight for my use and I started to investigate 'real' VMs), but I got a quick crash course by @DeHackEd and from my understanding, combining that with a
jail
(like *BSD does it) seems to be a much more reasonable thing for Linux...Searching for
zoned
in the issue tracker gives a couple of code matches, the most notable ones is:https://github.com/zfsonlinux/zfs/blob/d14cfd83dae0b1a261667acd416dba17a98d15fa/module/zfs/zfs_ioctl.c#L440-447
and
https://github.com/zfsonlinux/zfs/blob/1e8db7710220332808920a582e5794d6fc37b109/lib/libzfs/libzfs_mount.c#L752-757
So the big question is: How to proceed with this?
Update: It seems like mounting it the same was as a
legacy
filesystem worked:The text was updated successfully, but these errors were encountered: