Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

-81
-2
arch/mips/include/asm/vpe.h
··· 30 30 extern int vpe_notify(int index, struct vpe_notifications *notify); 31 31 32 32 extern void *vpe_get_shared(int index); 33 - extern int vpe_getuid(int index); 34 - extern int vpe_getgid(int index); 35 33 extern char *vpe_getcwd(int index); 36 34 37 35 #endif /* _ASM_VPE_H */
-28
arch/mips/kernel/vpe.c
··· 105 105 unsigned long len; 106 106 char *pbuffer; 107 107 unsigned long plen; 108 - unsigned int uid, gid; 109 108 char cwd[VPE_PATH_MAX]; 110 109 111 110 unsigned long __start; ··· 1082 1083 v->load_addr = NULL; 1083 1084 v->len = 0; 1084 1085 1085 - v->uid = filp->f_cred->fsuid; 1086 - v->gid = filp->f_cred->fsgid; 1087 - 1088 1086 v->cwd[0] = 0; 1089 1087 ret = getcwd(v->cwd, VPE_PATH_MAX); 1090 1088 if (ret < 0) ··· 1264 1268 } 1265 1269 1266 1270 EXPORT_SYMBOL(vpe_get_shared); 1267 - 1268 - int vpe_getuid(int index) 1269 - { 1270 - struct vpe *v; 1271 - 1272 - if ((v = get_vpe(index)) == NULL) 1273 - return -1; 1274 - 1275 - return v->uid; 1276 - } 1277 - 1278 - EXPORT_SYMBOL(vpe_getuid); 1279 - 1280 - int vpe_getgid(int index) 1281 - { 1282 - struct vpe *v; 1283 - 1284 - if ((v = get_vpe(index)) == NULL) 1285 - return -1; 1286 - 1287 - return v->gid; 1288 - } 1289 - 1290 - EXPORT_SYMBOL(vpe_getgid); 1291 1271 1292 1272 int vpe_notify(int index, struct vpe_notifications *notify) 1293 1273 {
-3
include/linux/posix_acl.h
··· 39 39 union { 40 40 kuid_t e_uid; 41 41 kgid_t e_gid; 42 - #ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS 43 - unsigned int e_id; 44 - #endif 45 42 }; 46 43 }; 47 44
-15
include/linux/projid.h
··· 18 18 19 19 typedef __kernel_uid32_t projid_t; 20 20 21 - #ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS 22 - 23 21 typedef struct { 24 22 projid_t val; 25 23 } kprojid_t; ··· 28 30 } 29 31 30 32 #define KPROJIDT_INIT(value) (kprojid_t){ value } 31 - 32 - #else 33 - 34 - typedef projid_t kprojid_t; 35 - 36 - static inline projid_t __kprojid_val(kprojid_t projid) 37 - { 38 - return projid; 39 - } 40 - 41 - #define KPROJIDT_INIT(value) ((kprojid_t) value ) 42 - 43 - #endif 44 33 45 34 #define INVALID_PROJID KPROJIDT_INIT(-1) 46 35 #define OVERFLOW_PROJID 65534
-22
include/linux/uidgid.h
··· 17 17 struct user_namespace; 18 18 extern struct user_namespace init_user_ns; 19 19 20 - #ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS 21 - 22 20 typedef struct { 23 21 uid_t val; 24 22 } kuid_t; ··· 38 40 { 39 41 return gid.val; 40 42 } 41 - 42 - #else 43 - 44 - typedef uid_t kuid_t; 45 - typedef gid_t kgid_t; 46 - 47 - static inline uid_t __kuid_val(kuid_t uid) 48 - { 49 - return uid; 50 - } 51 - 52 - static inline gid_t __kgid_val(kgid_t gid) 53 - { 54 - return gid; 55 - } 56 - 57 - #define KUIDT_INIT(value) ((kuid_t) value ) 58 - #define KGIDT_INIT(value) ((kgid_t) value ) 59 - 60 - #endif 61 43 62 44 #define GLOBAL_ROOT_UID KUIDT_INIT(0) 63 45 #define GLOBAL_ROOT_GID KGIDT_INIT(0)
-11
init/Kconfig
··· 1116 1116 1117 1117 config USER_NS 1118 1118 bool "User namespace" 1119 - select UIDGID_STRICT_TYPE_CHECKS 1120 - 1121 1119 default n 1122 1120 help 1123 1121 This allows containers, i.e. vservers, to use user namespaces ··· 1146 1148 of the network stack. 1147 1149 1148 1150 endif # NAMESPACES 1149 - 1150 - config UIDGID_STRICT_TYPE_CHECKS 1151 - bool "Require conversions between uid/gids and their internal representation" 1152 - default n 1153 - help 1154 - While the nececessary conversions are being added to all subsystems this option allows 1155 - the code to continue to build for unconverted subsystems. 1156 - 1157 - Say Y here if you want the strict type checking enabled 1158 1151 1159 1152 config SCHED_AUTOGROUP 1160 1153 bool "Automatic process group scheduling"