Commit d4a63a83 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

Pull user namespaces work from Eric Biederman:
 "The work to convert the kernel to use kuid_t and kgid_t has been
  finished since 3.12 so it is time to remove the scaffolding that
  allowed the work to progress incrementally.

  The first patch on this branch just removes the scaffolding, ensuring
  we will always get compile errors if people accidentally try the
  userspace and the kernel uid and gid types.  The second patch an
  overlooked and unused chunk of mips code that that fails to build
  after the first patch.

  The code hasn't been in linux-next for long (as I was out of it and
  could not sheppared the cold properly) but the patch has been around
  for a long time just waiting for the day when I had finished the
  uid/gid conversions.  Putting the code in linux-next did find the
  compile failure on mips so I took the time to get that fix reviewed
  and included.  Beyond that I am not too worried about errors because
  all these two patches do is delete a modest amount of code"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  MIPS: VPE: Remove vpe_getuid and vpe_getgid
  userns:  userns: Remove UIDGID_STRICT_TYPE_CHECKS
parents 7ae0e06b f58437f1
...@@ -30,8 +30,6 @@ struct vpe_notifications { ...@@ -30,8 +30,6 @@ struct vpe_notifications {
extern int vpe_notify(int index, struct vpe_notifications *notify); extern int vpe_notify(int index, struct vpe_notifications *notify);
extern void *vpe_get_shared(int index); extern void *vpe_get_shared(int index);
extern int vpe_getuid(int index);
extern int vpe_getgid(int index);
extern char *vpe_getcwd(int index); extern char *vpe_getcwd(int index);
#endif /* _ASM_VPE_H */ #endif /* _ASM_VPE_H */
...@@ -105,7 +105,6 @@ struct vpe { ...@@ -105,7 +105,6 @@ struct vpe {
unsigned long len; unsigned long len;
char *pbuffer; char *pbuffer;
unsigned long plen; unsigned long plen;
unsigned int uid, gid;
char cwd[VPE_PATH_MAX]; char cwd[VPE_PATH_MAX];
unsigned long __start; unsigned long __start;
...@@ -1083,9 +1082,6 @@ static int vpe_open(struct inode *inode, struct file *filp) ...@@ -1083,9 +1082,6 @@ static int vpe_open(struct inode *inode, struct file *filp)
v->load_addr = NULL; v->load_addr = NULL;
v->len = 0; v->len = 0;
v->uid = filp->f_cred->fsuid;
v->gid = filp->f_cred->fsgid;
v->cwd[0] = 0; v->cwd[0] = 0;
ret = getcwd(v->cwd, VPE_PATH_MAX); ret = getcwd(v->cwd, VPE_PATH_MAX);
if (ret < 0) if (ret < 0)
...@@ -1269,30 +1265,6 @@ void *vpe_get_shared(int index) ...@@ -1269,30 +1265,6 @@ void *vpe_get_shared(int index)
EXPORT_SYMBOL(vpe_get_shared); EXPORT_SYMBOL(vpe_get_shared);
int vpe_getuid(int index)
{
struct vpe *v;
if ((v = get_vpe(index)) == NULL)
return -1;
return v->uid;
}
EXPORT_SYMBOL(vpe_getuid);
int vpe_getgid(int index)
{
struct vpe *v;
if ((v = get_vpe(index)) == NULL)
return -1;
return v->gid;
}
EXPORT_SYMBOL(vpe_getgid);
int vpe_notify(int index, struct vpe_notifications *notify) int vpe_notify(int index, struct vpe_notifications *notify)
{ {
struct vpe *v; struct vpe *v;
......
...@@ -39,9 +39,6 @@ struct posix_acl_entry { ...@@ -39,9 +39,6 @@ struct posix_acl_entry {
union { union {
kuid_t e_uid; kuid_t e_uid;
kgid_t e_gid; kgid_t e_gid;
#ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS
unsigned int e_id;
#endif
}; };
}; };
......
...@@ -18,8 +18,6 @@ extern struct user_namespace init_user_ns; ...@@ -18,8 +18,6 @@ extern struct user_namespace init_user_ns;
typedef __kernel_uid32_t projid_t; typedef __kernel_uid32_t projid_t;
#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
typedef struct { typedef struct {
projid_t val; projid_t val;
} kprojid_t; } kprojid_t;
...@@ -31,19 +29,6 @@ static inline projid_t __kprojid_val(kprojid_t projid) ...@@ -31,19 +29,6 @@ static inline projid_t __kprojid_val(kprojid_t projid)
#define KPROJIDT_INIT(value) (kprojid_t){ value } #define KPROJIDT_INIT(value) (kprojid_t){ value }
#else
typedef projid_t kprojid_t;
static inline projid_t __kprojid_val(kprojid_t projid)
{
return projid;
}
#define KPROJIDT_INIT(value) ((kprojid_t) value )
#endif
#define INVALID_PROJID KPROJIDT_INIT(-1) #define INVALID_PROJID KPROJIDT_INIT(-1)
#define OVERFLOW_PROJID 65534 #define OVERFLOW_PROJID 65534
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
struct user_namespace; struct user_namespace;
extern struct user_namespace init_user_ns; extern struct user_namespace init_user_ns;
#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
typedef struct { typedef struct {
uid_t val; uid_t val;
} kuid_t; } kuid_t;
...@@ -41,26 +39,6 @@ static inline gid_t __kgid_val(kgid_t gid) ...@@ -41,26 +39,6 @@ static inline gid_t __kgid_val(kgid_t gid)
return gid.val; return gid.val;
} }
#else
typedef uid_t kuid_t;
typedef gid_t kgid_t;
static inline uid_t __kuid_val(kuid_t uid)
{
return uid;
}
static inline gid_t __kgid_val(kgid_t gid)
{
return gid;
}
#define KUIDT_INIT(value) ((kuid_t) value )
#define KGIDT_INIT(value) ((kgid_t) value )
#endif
#define GLOBAL_ROOT_UID KUIDT_INIT(0) #define GLOBAL_ROOT_UID KUIDT_INIT(0)
#define GLOBAL_ROOT_GID KGIDT_INIT(0) #define GLOBAL_ROOT_GID KGIDT_INIT(0)
......
...@@ -1116,8 +1116,6 @@ config IPC_NS ...@@ -1116,8 +1116,6 @@ config IPC_NS
config USER_NS config USER_NS
bool "User namespace" bool "User namespace"
select UIDGID_STRICT_TYPE_CHECKS
default n default n
help help
This allows containers, i.e. vservers, to use user namespaces This allows containers, i.e. vservers, to use user namespaces
...@@ -1149,15 +1147,6 @@ config NET_NS ...@@ -1149,15 +1147,6 @@ config NET_NS
endif # NAMESPACES endif # NAMESPACES
config UIDGID_STRICT_TYPE_CHECKS
bool "Require conversions between uid/gids and their internal representation"
default n
help
While the nececessary conversions are being added to all subsystems this option allows
the code to continue to build for unconverted subsystems.
Say Y here if you want the strict type checking enabled
config SCHED_AUTOGROUP config SCHED_AUTOGROUP
bool "Automatic process group scheduling" bool "Automatic process group scheduling"
select CGROUPS select CGROUPS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment