Linux Container Development
 help / color / mirror / Atom feed
From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman)
To: Zhao Hongjiang <zhaohongjiang37-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH RFC 01/12] userns: Support 9p interacting with multiple user namespaces
Date: Thu, 22 Nov 2012 03:58:17 -0800	[thread overview]
Message-ID: <87vccxzw6e.fsf@xmission.com> (raw)
In-Reply-To: <50AC9CD8.8020207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Zhao Hongjiang's message of "Wed, 21 Nov 2012 17:20:24 +0800")

Zhao Hongjiang <zhaohongjiang37-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> On 2012/11/20 20:43, Eric W. Biederman wrote:
>> From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
>
>> diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
>> index d934f04..1c750ab 100644
>> --- a/fs/9p/v9fs.c
>> +++ b/fs/9p/v9fs.c
>> @@ -161,7 +161,13 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
>>  				ret = r;
>>  				continue;
>>  			}
>> -			v9ses->dfltuid = option;
>> +			v9ses->dfltuid = make_kuid(&init_user_ns, option);
>
> I think the init_user_ns should be current_user_ns() cause the value is come from userspace
> and in kernel we should mapping it to its own user_ns.

Good point.  current_user_ns() is more appropriate and maintainable.

For now you can only mount 9p when current_user_ns() == &init_user_ns
but that might change in the future.

Thanks,
Eric

  parent reply	other threads:[~2012-11-22 11:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21  9:20 [PATCH RFC 01/12] userns: Support 9p interacting with multiple user namespaces Zhao Hongjiang
     [not found] ` <50AC9CD8.8020207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-11-22 11:58   ` Eric W. Biederman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-20 12:42 [PATCH RFC 0/12] Final userns conversions Eric W. Biederman
     [not found] ` <87pq38wimv.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-11-20 12:43   ` [PATCH RFC 01/12] userns: Support 9p interacting with multiple user namespaces Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vccxzw6e.fsf@xmission.com \
    --to=ebiederm-as9lmozglivwk0htik3j/w@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=zhaohongjiang37-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox