Commit 261000a56b6382f597bcb12000f55c9ff26a1efb

Authored by Eric W. Biederman
1 parent 41301ae78a

userns: userns: Remove UIDGID_STRICT_TYPE_CHECKS

Removing UIDGID_STRICT_TYPE_CHECKS simplifies the code and always
generates a compile error if the uids and kuids or gids and kgids are
mixed by accident.  Now that the appropriate conversions have been
placed throughout the kernel there is no longer a need for a mode where
we don't detect them as compile errors.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

Showing 4 changed files with 0 additions and 51 deletions Side-by-side Diff

include/linux/posix_acl.h
... ... @@ -39,9 +39,6 @@
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  
include/linux/projid.h
... ... @@ -18,8 +18,6 @@
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;
... ... @@ -30,19 +28,6 @@
30 28 }
31 29  
32 30 #define KPROJIDT_INIT(value) (kprojid_t){ value }
33   -
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 31  
47 32 #define INVALID_PROJID KPROJIDT_INIT(-1)
48 33 #define OVERFLOW_PROJID 65534
include/linux/uidgid.h
... ... @@ -17,8 +17,6 @@
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;
... ... @@ -40,26 +38,6 @@
40 38 {
41 39 return gid.val;
42 40 }
43   -
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 41  
64 42 #define GLOBAL_ROOT_UID KUIDT_INIT(0)
65 43 #define GLOBAL_ROOT_GID KGIDT_INIT(0)
... ... @@ -1110,8 +1110,6 @@
1110 1110  
1111 1111 config USER_NS
1112 1112 bool "User namespace"
1113   - select UIDGID_STRICT_TYPE_CHECKS
1114   -
1115 1113 default n
1116 1114 help
1117 1115 This allows containers, i.e. vservers, to use user namespaces
... ... @@ -1142,15 +1140,6 @@
1142 1140 of the network stack.
1143 1141  
1144 1142 endif # NAMESPACES
1145   -
1146   -config UIDGID_STRICT_TYPE_CHECKS
1147   - bool "Require conversions between uid/gids and their internal representation"
1148   - default n
1149   - help
1150   - While the nececessary conversions are being added to all subsystems this option allows
1151   - the code to continue to build for unconverted subsystems.
1152   -
1153   - Say Y here if you want the strict type checking enabled
1154 1143  
1155 1144 config SCHED_AUTOGROUP
1156 1145 bool "Automatic process group scheduling"