Linux Container Development
 help / color / mirror / Atom feed
From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Mark Fasheh <mfasheh-IBi9RG/b67k@public.gmane.org>,
	Linux Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH RFC 09/12] userns: Convert ocfs2 to use kuid and kgid where appropriate
Date: Wed, 13 Feb 2013 09:12:37 -0800	[thread overview]
Message-ID: <874nhg5e9m.fsf@xmission.com> (raw)
In-Reply-To: <20121121195114.GM2822@localhost> (Joel Becker's message of "Wed, 21 Nov 2012 11:51:15 -0800")

Joel Becker <jlbec-aKy9MeLSZ9dg9hUCZPvPmw@public.gmane.org> writes:

> On Tue, Nov 20, 2012 at 04:43:37AM -0800, Eric W. Biederman wrote:
>> --- a/fs/ocfs2/file.c
>> +++ b/fs/ocfs2/file.c
>> @@ -1116,7 +1116,8 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
>>  			    (unsigned long long)OCFS2_I(inode)->ip_blkno,
>>  			    dentry->d_name.len, dentry->d_name.name,
>>  			    attr->ia_valid, attr->ia_mode,
>> -			    attr->ia_uid, attr->ia_gid);
>> +			    from_kuid(&init_user_ns, attr->ia_uid),
>> +			    from_kgid(&init_user_ns, attr->ia_gid));
>
> Dear Eric,
> 	I have a similar question about init_user_ns to Dave.  As far as
> I can tell, using init_user_ns here means we'll never get translations
> based on the current process namespace.  It just so happens that
> include/linux/user_namespace.h doesn't allow new namespaces yet, but I
> can't see why we would propagate that knowledge elsewhere.
>
> 	Is there some magic about when init_user_ns should be used
> regardless?

Trace statements are fancy print statements, and the tracing
infrastructure is not setup to deal with anyone other than the
one-true-root using it.  Trace is like printk in that way.

So for print statements I always convert the value into the initial user
namespace which every value can be converted to without loss, and is the
same value that we have always been printing.

If at some point the tracing people figure out how deal with multiple
user namespaces it won't be hard to pass the kuids and kgids into the
trace funtions and have the readers of the data perform the conversions.

Eric

  parent reply	other threads:[~2013-02-13 17:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
     [not found]     ` <1353415420-5457-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-11-20 12:43       ` [PATCH RFC 02/12] userns: Convert afs to use kuid/kgid where appropriate Eric W. Biederman
2012-11-20 12:43       ` [PATCH RFC 03/12] userns: Convert ceph " Eric W. Biederman
     [not found]         ` <1353415420-5457-3-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-11-20 16:48           ` Sage Weil
     [not found]         ` <alpine.DEB.2.00.1211200847110.7369@cobra.newdream.net>
     [not found]           ` <alpine.DEB.2.00.1211200847110.7369-vIokxiIdD2AQNTJnQDzGJqxOck334EZe@public.gmane.org>
2012-11-20 17:15             ` Eric W. Biederman
2012-11-20 12:43       ` [PATCH RFC 04/12] userns: Convert cifs " Eric W. Biederman
     [not found]         ` <1353415420-5457-4-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-11-20 16:56           ` Steve French
     [not found]             ` <CAH2r5mt91Av7w6GQUPNu2A9EGRNbPGGAhMO=EobOMi5Cn8gh5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-20 17:22               ` Eric W. Biederman
2012-11-25 12:47           ` Jeff Layton
2012-11-20 12:43       ` [PATCH RFC 05/12] userns: Convert coda's " Eric W. Biederman
2012-11-20 12:43       ` [PATCH RFC 06/12] userns: Convert gfs2 " Eric W. Biederman
     [not found]         ` <1353415420-5457-6-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-11-22  9:47           ` Steven Whitehouse
2012-11-20 12:43       ` [PATCH RFC 07/12] userns: Convert ncpfs to use kuid and kgid " Eric W. Biederman
2012-11-20 12:43       ` [PATCH RFC 08/12] userns: Convert nfs and nfsd to use kuid/kgid " Eric W. Biederman
2012-11-20 12:43       ` [PATCH RFC 09/12] userns: Convert ocfs2 to use kuid and kgid " Eric W. Biederman
     [not found]         ` <1353415420-5457-9-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-11-21 19:51           ` Joel Becker
2012-11-21 19:59           ` Joel Becker
2013-02-13 17:41             ` Eric W. Biederman
     [not found]         ` <20121121195114.GM2822@localhost>
2013-02-13 17:12           ` Eric W. Biederman [this message]
2012-11-20 12:43       ` [PATCH RFC 10/12] userns: Convert xfs to use kuid/kgid/kprojid " Eric W. Biederman
     [not found]         ` <1353415420-5457-10-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-11-20 23:55           ` Dave Chinner
     [not found]         ` <20121120235524.GK2591@dastard>
2012-11-21 19:52           ` Joel Becker
     [not found]           ` <20121121195246.GN2822@localhost>
2013-02-13 18:13             ` Eric W. Biederman
     [not found]               ` <87obfoxetf.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2013-02-14  2:19                 ` Dave Chinner
2013-02-18  1:25                   ` Eric W. Biederman
     [not found]                     ` <87621qpg4o.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2013-02-19  3:30                       ` Dave Chinner
2012-11-20 12:43       ` [PATCH RFC 11/12] userns: Now that everything has been converted remove the unnecessary infrastructure Eric W. Biederman
2012-11-20 12:43       ` [PATCH RFC 12/12] userns: Remove the EXPERMINTAL kconfig tag Eric W. Biederman
2012-11-21  0:09   ` [PATCH RFC 0/12] Final userns conversions Dave Chinner

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=874nhg5e9m.fsf@xmission.com \
    --to=ebiederm-as9lmozglivwk0htik3j/w@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mfasheh-IBi9RG/b67k@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