diff options
Diffstat (limited to 'include/linux/cred.h')
-rw-r--r-- | include/linux/cred.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/cred.h b/include/linux/cred.h index 98f46efbe2d2..40308969ed00 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -269,7 +269,7 @@ static inline void put_cred(const struct cred *_cred) | |||
269 | * since nobody else can modify it. | 269 | * since nobody else can modify it. |
270 | */ | 270 | */ |
271 | #define current_cred() \ | 271 | #define current_cred() \ |
272 | (*(__force struct cred **)¤t->cred) | 272 | rcu_dereference_protected(current->cred, 1) |
273 | 273 | ||
274 | /** | 274 | /** |
275 | * __task_cred - Access a task's objective credentials | 275 | * __task_cred - Access a task's objective credentials |
@@ -307,7 +307,7 @@ static inline void put_cred(const struct cred *_cred) | |||
307 | #define get_current_user() \ | 307 | #define get_current_user() \ |
308 | ({ \ | 308 | ({ \ |
309 | struct user_struct *__u; \ | 309 | struct user_struct *__u; \ |
310 | struct cred *__cred; \ | 310 | const struct cred *__cred; \ |
311 | __cred = current_cred(); \ | 311 | __cred = current_cred(); \ |
312 | __u = get_uid(__cred->user); \ | 312 | __u = get_uid(__cred->user); \ |
313 | __u; \ | 313 | __u; \ |
@@ -322,7 +322,7 @@ static inline void put_cred(const struct cred *_cred) | |||
322 | #define get_current_groups() \ | 322 | #define get_current_groups() \ |
323 | ({ \ | 323 | ({ \ |
324 | struct group_info *__groups; \ | 324 | struct group_info *__groups; \ |
325 | struct cred *__cred; \ | 325 | const struct cred *__cred; \ |
326 | __cred = current_cred(); \ | 326 | __cred = current_cred(); \ |
327 | __groups = get_group_info(__cred->group_info); \ | 327 | __groups = get_group_info(__cred->group_info); \ |
328 | __groups; \ | 328 | __groups; \ |