* User namespace over 9p
@ 2014-05-27 10:25 Alin Dobre
[not found] ` <53846804.6080408-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Alin Dobre @ 2014-05-27 10:25 UTC (permalink / raw)
To: linux-fsdevel, containers, v9fs-developer, Eric W. Biederman,
Eric Van Hensbergen
Hello,
Continuing the struggle to run containers over the 9p filesystem I am
now running into another issue.
A simple container with user namespace mapping UID -2 (4294967294) to
root can run a container image found in /tmp/src without any problems.
When I export that /tmp/src path via 9p and mount it in /tmp/dst,
running the same container over /tmp/dst fails to allow chown (and
probably chmod) system calls to be successful. This happens because 9p
considers that the UID which runs the system calls is actually -2, but
it's actually 0, because the lchown system call is run inside the
namespace, not outside it. So, 9p should consider that the UID which
does the system call is root.
Do I understand this correctly as a problem, or does it work as
intended? If latter, do you have any insights on how to achieve running
containers in this scenario?
Cheers,
Alin.
^ permalink raw reply [flat|nested] 5+ messages in thread[parent not found: <53846804.6080408-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org>]
* Re: User namespace over 9p [not found] ` <53846804.6080408-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org> @ 2014-05-27 10:39 ` Eric W. Biederman 2014-05-27 10:51 ` Alin Dobre [not found] ` <87fvjvpksl.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org> 0 siblings, 2 replies; 5+ messages in thread From: Eric W. Biederman @ 2014-05-27 10:39 UTC (permalink / raw) To: Alin Dobre Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, v9fs-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Eric Van Hensbergen Alin Dobre <alin.dobre-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org> writes: > Hello, > > Continuing the struggle to run containers over the 9p filesystem I am > now running into another issue. > > A simple container with user namespace mapping UID -2 (4294967294) to > root can run a container image found in /tmp/src without any problems. > When I export that /tmp/src path via 9p and mount it in /tmp/dst, > running the same container over /tmp/dst fails to allow chown (and > probably chmod) system calls to be successful. This happens because 9p > considers that the UID which runs the system calls is actually -2, but > it's actually 0, because the lchown system call is run inside the > namespace, not outside it. So, 9p should consider that the UID which > does the system call is root. No the UID is actually -2. (-2 is a little dangerous to use because sometimes -2 is used for the nobody user and similar special purposes). There is some minor relaxation of the rules in the vfs to allow changing to a uid you have mapped in your user namespace. Which is why chown works at all. > Do I understand this correctly as a problem, or does it work as > intended? If latter, do you have any insights on how to achieve running > containers in this scenario? If the permission check is made on the kernel with user namespaces we can reasonablly make it work. Otherwise we can not. That is a danger of using remote filesystems they can sometimes have weird arbitrary rules you were not expected. Eric ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: User namespace over 9p 2014-05-27 10:39 ` Eric W. Biederman @ 2014-05-27 10:51 ` Alin Dobre [not found] ` <87fvjvpksl.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org> 1 sibling, 0 replies; 5+ messages in thread From: Alin Dobre @ 2014-05-27 10:51 UTC (permalink / raw) To: Eric W. Biederman Cc: linux-fsdevel, containers, v9fs-developer, Eric Van Hensbergen Eric, thanks for the response. On 27/05/14 11:39, Eric W. Biederman wrote: >> Do I understand this correctly as a problem, or does it work as >> > intended? If latter, do you have any insights on how to achieve running >> > containers in this scenario? > If the permission check is made on the kernel with user namespaces we > can reasonablly make it work. Otherwise we can not. That is a danger > of using remote filesystems they can sometimes have weird arbitrary > rules you were not expected. > I'm using diod as the 9p server, and it seems that it receives the calling UID as -2 from the 9p kernel module on the client side, which has user namespaces enabled. Cheers, Alin. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <87fvjvpksl.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>]
* Re: User namespace over 9p [not found] ` <87fvjvpksl.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org> @ 2014-06-10 12:58 ` Alin Dobre [not found] ` <539700EC.5010407-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Alin Dobre @ 2014-06-10 12:58 UTC (permalink / raw) To: Eric W. Biederman, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, v9fs-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Cc: Eric Van Hensbergen On 27/05/14 11:39, Eric W. Biederman wrote: > If the permission check is made on the kernel with user namespaces we > can reasonablly make it work. I'm pretty sure this is the case and I appreciate your help on this matter. Cheers! Alin. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <539700EC.5010407-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org>]
* Re: User namespace over 9p [not found] ` <539700EC.5010407-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org> @ 2014-06-11 23:14 ` Eric W. Biederman 0 siblings, 0 replies; 5+ messages in thread From: Eric W. Biederman @ 2014-06-11 23:14 UTC (permalink / raw) To: Alin Dobre Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, v9fs-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Eric Van Hensbergen Alin Dobre <alin.dobre-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org> writes: > On 27/05/14 11:39, Eric W. Biederman wrote: >> If the permission check is made on the kernel with user namespaces we >> can reasonablly make it work. > > I'm pretty sure this is the case and I appreciate your help on this > matter. Point me to the permission check in 9p on the client that is failing and I can advise you on how to update the permission check safely. Eric ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-11 23:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27 10:25 User namespace over 9p Alin Dobre
[not found] ` <53846804.6080408-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org>
2014-05-27 10:39 ` Eric W. Biederman
2014-05-27 10:51 ` Alin Dobre
[not found] ` <87fvjvpksl.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-06-10 12:58 ` Alin Dobre
[not found] ` <539700EC.5010407-1hSFou9RDDldEee+Cai+ZQ@public.gmane.org>
2014-06-11 23:14 ` Eric W. Biederman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).