Skip to content

Commit

Permalink
userns: userns: Remove UIDGID_STRICT_TYPE_CHECKS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric W. Biederman committed Nov 27, 2013
1 parent 41301ae commit 261000a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 51 deletions.
3 changes: 0 additions & 3 deletions include/linux/posix_acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ struct posix_acl_entry {
union {
kuid_t e_uid;
kgid_t e_gid;
#ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS
unsigned int e_id;
#endif
};
};

Expand Down
15 changes: 0 additions & 15 deletions include/linux/projid.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ extern struct user_namespace init_user_ns;

typedef __kernel_uid32_t projid_t;

#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS

typedef struct {
projid_t val;
} kprojid_t;
Expand All @@ -31,19 +29,6 @@ static inline projid_t __kprojid_val(kprojid_t projid)

#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 OVERFLOW_PROJID 65534

Expand Down
22 changes: 0 additions & 22 deletions include/linux/uidgid.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
struct user_namespace;
extern struct user_namespace init_user_ns;

#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS

typedef struct {
uid_t val;
} kuid_t;
Expand All @@ -41,26 +39,6 @@ static inline gid_t __kgid_val(kgid_t gid)
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_GID KGIDT_INIT(0)

Expand Down
11 changes: 0 additions & 11 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1110,8 +1110,6 @@ config IPC_NS

config USER_NS
bool "User namespace"
select UIDGID_STRICT_TYPE_CHECKS

default n
help
This allows containers, i.e. vservers, to use user namespaces
Expand Down Expand Up @@ -1143,15 +1141,6 @@ config NET_NS

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
bool "Automatic process group scheduling"
select EVENTFD
Expand Down

0 comments on commit 261000a

Please sign in to comment.