Messages in this thread | | | Date | Tue, 1 Mar 2011 17:07:29 -0600 | From | "Serge E. Hallyn" <> | Subject | Re: [PATCH 09/10] userns: check user namespace for task->file uid equivalence checks |
| |
Quoting Nathan Lynch (ntl@pobox.com): > On Thu, 2011-02-24 at 15:03 +0000, Serge E. Hallyn wrote: > > --- a/include/linux/fs.h > > +++ b/include/linux/fs.h > > @@ -1446,8 +1446,13 @@ enum { > > #define put_fs_excl() atomic_dec(¤t->fs_excl) > > #define has_fs_excl() atomic_read(¤t->fs_excl) > > > > -#define is_owner_or_cap(inode) \ > > - ((current_fsuid() == (inode)->i_uid) || capable(CAP_FOWNER)) > > +/* > > + * until VFS tracks user namespaces for inodes, just make all files > > + * belong to init_user_ns > > + */ > > +extern struct user_namespace init_user_ns; > > init_user_ns gets declared in fs.h in this patch, utsname.h in patch #1, > capability.h in #2, ipc_namespace.h in #7. Could this declaration be > kept to a single header? >
ipc/msgutil.c includes security.h which includes fs.h, so we should be able to drop the one in ipc_namespace.h. The one in utsname.h is there for init/version.c and needed AFAICS.
The one in capability.h should be able to go when has_capability* are turned into functions. They couldn't be turned into static functions in capability.h (left as exercise for reader), but they can be made full-fledged functions in kernel/capability.c. I will do that in a follow-on patch and try to remove the extra init_user_ns defines as well.
thanks, -serge
| |