diff options
Diffstat (limited to 'include/linux/user_namespace.h')
-rw-r--r-- | include/linux/user_namespace.h | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index faf467944ba..4e72922e5a7 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -6,14 +6,24 @@ #include <linux/sched.h> #include <linux/err.h> -#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7) -#define UIDHASH_SZ (1 << UIDHASH_BITS) +#define UID_GID_MAP_MAX_EXTENTS 5 + +struct uid_gid_map { /* 64 bytes -- 1 cache line */ + u32 nr_extents; + struct uid_gid_extent { + u32 first; + u32 lower_first; + u32 count; + } extent[UID_GID_MAP_MAX_EXTENTS]; +}; struct user_namespace { + struct uid_gid_map uid_map; + struct uid_gid_map gid_map; struct kref kref; - struct hlist_head uidhash_table[UIDHASH_SZ]; - struct user_struct *creator; - struct work_struct destroyer; + struct user_namespace *parent; + kuid_t owner; + kgid_t group; }; extern struct user_namespace init_user_ns; @@ -36,9 +46,11 @@ static inline void put_user_ns(struct user_namespace *ns) kref_put(&ns->kref, free_user_ns); } -uid_t user_ns_map_uid(struct user_namespace *to, const struct cred *cred, uid_t uid); -gid_t user_ns_map_gid(struct user_namespace *to, const struct cred *cred, gid_t gid); - +struct seq_operations; +extern struct seq_operations proc_uid_seq_operations; +extern struct seq_operations proc_gid_seq_operations; +extern ssize_t proc_uid_map_write(struct file *, const char __user *, size_t, loff_t *); +extern ssize_t proc_gid_map_write(struct file *, const char __user *, size_t, loff_t *); #else static inline struct user_namespace *get_user_ns(struct user_namespace *ns) @@ -55,17 +67,6 @@ static inline void put_user_ns(struct user_namespace *ns) { } -static inline uid_t user_ns_map_uid(struct user_namespace *to, - const struct cred *cred, uid_t uid) -{ - return uid; -} -static inline gid_t user_ns_map_gid(struct user_namespace *to, - const struct cred *cred, gid_t gid) -{ - return gid; -} - #endif #endif /* _LINUX_USER_H */ |