aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cred.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cred.h')
-rw-r--r--include/linux/cred.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 9aeeb0ba2003..be16b61283cc 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -146,6 +146,7 @@ struct cred {
146 void *security; /* subjective LSM security */ 146 void *security; /* subjective LSM security */
147#endif 147#endif
148 struct user_struct *user; /* real user ID subscription */ 148 struct user_struct *user; /* real user ID subscription */
149 struct user_namespace *user_ns; /* cached user->user_ns */
149 struct group_info *group_info; /* supplementary groups for euid/fsgid */ 150 struct group_info *group_info; /* supplementary groups for euid/fsgid */
150 struct rcu_head rcu; /* RCU deletion hook */ 151 struct rcu_head rcu; /* RCU deletion hook */
151}; 152};
@@ -354,10 +355,15 @@ static inline void put_cred(const struct cred *_cred)
354#define current_fsgid() (current_cred_xxx(fsgid)) 355#define current_fsgid() (current_cred_xxx(fsgid))
355#define current_cap() (current_cred_xxx(cap_effective)) 356#define current_cap() (current_cred_xxx(cap_effective))
356#define current_user() (current_cred_xxx(user)) 357#define current_user() (current_cred_xxx(user))
357#define _current_user_ns() (current_cred_xxx(user)->user_ns)
358#define current_security() (current_cred_xxx(security)) 358#define current_security() (current_cred_xxx(security))
359 359
360extern struct user_namespace *current_user_ns(void); 360#ifdef CONFIG_USER_NS
361#define current_user_ns() (current_cred_xxx(user_ns))
362#else
363extern struct user_namespace init_user_ns;
364#define current_user_ns() (&init_user_ns)
365#endif
366
361 367
362#define current_uid_gid(_uid, _gid) \ 368#define current_uid_gid(_uid, _gid) \
363do { \ 369do { \