Skip to content

Commit d4a63a8

Browse files
committed
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
2 parents 7ae0e06 + f58437f commit d4a63a8

6 files changed

Lines changed: 0 additions & 81 deletions

File tree

‎arch/mips/include/asm/vpe.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ struct vpe_notifications {
3030
extern int vpe_notify(int index, struct vpe_notifications *notify);
3131

3232
extern void *vpe_get_shared(int index);
33-
extern int vpe_getuid(int index);
34-
extern int vpe_getgid(int index);
3533
extern char *vpe_getcwd(int index);
3634

3735
#endif /* _ASM_VPE_H */

‎arch/mips/kernel/vpe.c‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ struct vpe {
105105
unsigned long len;
106106
char *pbuffer;
107107
unsigned long plen;
108-
unsigned int uid, gid;
109108
char cwd[VPE_PATH_MAX];
110109

111110
unsigned long __start;
@@ -1083,9 +1082,6 @@ static int vpe_open(struct inode *inode, struct file *filp)
10831082
v->load_addr = NULL;
10841083
v->len = 0;
10851084

1086-
v->uid = filp->f_cred->fsuid;
1087-
v->gid = filp->f_cred->fsgid;
1088-
10891085
v->cwd[0] = 0;
10901086
ret = getcwd(v->cwd, VPE_PATH_MAX);
10911087
if (ret < 0)
@@ -1269,30 +1265,6 @@ void *vpe_get_shared(int index)
12691265

12701266
EXPORT_SYMBOL(vpe_get_shared);
12711267

1272-
int vpe_getuid(int index)
1273-
{
1274-
struct vpe *v;
1275-
1276-
if ((v = get_vpe(index)) == NULL)
1277-
return -1;
1278-
1279-
return v->uid;
1280-
}
1281-
1282-
EXPORT_SYMBOL(vpe_getuid);
1283-
1284-
int vpe_getgid(int index)
1285-
{
1286-
struct vpe *v;
1287-
1288-
if ((v = get_vpe(index)) == NULL)
1289-
return -1;
1290-
1291-
return v->gid;
1292-
}
1293-
1294-
EXPORT_SYMBOL(vpe_getgid);
1295-
12961268
int vpe_notify(int index, struct vpe_notifications *notify)
12971269
{
12981270
struct vpe *v;

‎include/linux/posix_acl.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ struct posix_acl_entry {
3939
union {
4040
kuid_t e_uid;
4141
kgid_t e_gid;
42-
#ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS
43-
unsigned int e_id;
44-
#endif
4542
};
4643
};
4744

‎include/linux/projid.h‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ extern struct user_namespace init_user_ns;
1818

1919
typedef __kernel_uid32_t projid_t;
2020

21-
#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
22-
2321
typedef struct {
2422
projid_t val;
2523
} kprojid_t;
@@ -31,19 +29,6 @@ static inline projid_t __kprojid_val(kprojid_t projid)
3129

3230
#define KPROJIDT_INIT(value) (kprojid_t){ value }
3331

34-
#else
35-
36-
typedef projid_t kprojid_t;
37-
38-
static inline projid_t __kprojid_val(kprojid_t projid)
39-
{
40-
return projid;
41-
}
42-
43-
#define KPROJIDT_INIT(value) ((kprojid_t) value )
44-
45-
#endif
46-
4732
#define INVALID_PROJID KPROJIDT_INIT(-1)
4833
#define OVERFLOW_PROJID 65534
4934

‎include/linux/uidgid.h‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
struct user_namespace;
1818
extern struct user_namespace init_user_ns;
1919

20-
#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
21-
2220
typedef struct {
2321
uid_t val;
2422
} kuid_t;
@@ -41,26 +39,6 @@ static inline gid_t __kgid_val(kgid_t gid)
4139
return gid.val;
4240
}
4341

44-
#else
45-
46-
typedef uid_t kuid_t;
47-
typedef gid_t kgid_t;
48-
49-
static inline uid_t __kuid_val(kuid_t uid)
50-
{
51-
return uid;
52-
}
53-
54-
static inline gid_t __kgid_val(kgid_t gid)
55-
{
56-
return gid;
57-
}
58-
59-
#define KUIDT_INIT(value) ((kuid_t) value )
60-
#define KGIDT_INIT(value) ((kgid_t) value )
61-
62-
#endif
63-
6442
#define GLOBAL_ROOT_UID KUIDT_INIT(0)
6543
#define GLOBAL_ROOT_GID KGIDT_INIT(0)
6644

‎init/Kconfig‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,8 +1116,6 @@ config IPC_NS
11161116

11171117
config USER_NS
11181118
bool "User namespace"
1119-
select UIDGID_STRICT_TYPE_CHECKS
1120-
11211119
default n
11221120
help
11231121
This allows containers, i.e. vservers, to use user namespaces
@@ -1149,15 +1147,6 @@ config NET_NS
11491147

11501148
endif # NAMESPACES
11511149

1152-
config UIDGID_STRICT_TYPE_CHECKS
1153-
bool "Require conversions between uid/gids and their internal representation"
1154-
default n
1155-
help
1156-
While the nececessary conversions are being added to all subsystems this option allows
1157-
the code to continue to build for unconverted subsystems.
1158-
1159-
Say Y here if you want the strict type checking enabled
1160-
11611150
config SCHED_AUTOGROUP
11621151
bool "Automatic process group scheduling"
11631152
select CGROUPS

0 commit comments

Comments
 (0)