diff options
author | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 09:08:05 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 09:08:18 -0400 |
commit | e060c38434b2caa78efe7cedaff4191040b65a15 (patch) | |
tree | 407361230bf6733f63d8e788e4b5e6566ee04818 /include/linux/cred.h | |
parent | 10e4ac572eeffe5317019bd7330b6058a400dfc2 (diff) | |
parent | cc39c6a9bbdebfcf1a7dee64d83bf302bc38d941 (diff) |
Merge branch 'master' into for-next
Fast-forward merge with Linus to be able to merge patches
based on more recent version of the tree.
Diffstat (limited to 'include/linux/cred.h')
-rw-r--r-- | include/linux/cred.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/cred.h b/include/linux/cred.h index f240f2fa0197..40308969ed00 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/key.h> | 17 | #include <linux/key.h> |
18 | #include <linux/selinux.h> | 18 | #include <linux/selinux.h> |
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | 20 | ||
21 | struct user_struct; | 21 | struct user_struct; |
22 | struct cred; | 22 | struct cred; |
@@ -265,10 +265,11 @@ static inline void put_cred(const struct cred *_cred) | |||
265 | /** | 265 | /** |
266 | * current_cred - Access the current task's subjective credentials | 266 | * current_cred - Access the current task's subjective credentials |
267 | * | 267 | * |
268 | * Access the subjective credentials of the current task. | 268 | * Access the subjective credentials of the current task. RCU-safe, |
269 | * since nobody else can modify it. | ||
269 | */ | 270 | */ |
270 | #define current_cred() \ | 271 | #define current_cred() \ |
271 | (current->cred) | 272 | rcu_dereference_protected(current->cred, 1) |
272 | 273 | ||
273 | /** | 274 | /** |
274 | * __task_cred - Access a task's objective credentials | 275 | * __task_cred - Access a task's objective credentials |
@@ -306,8 +307,8 @@ static inline void put_cred(const struct cred *_cred) | |||
306 | #define get_current_user() \ | 307 | #define get_current_user() \ |
307 | ({ \ | 308 | ({ \ |
308 | struct user_struct *__u; \ | 309 | struct user_struct *__u; \ |
309 | struct cred *__cred; \ | 310 | const struct cred *__cred; \ |
310 | __cred = (struct cred *) current_cred(); \ | 311 | __cred = current_cred(); \ |
311 | __u = get_uid(__cred->user); \ | 312 | __u = get_uid(__cred->user); \ |
312 | __u; \ | 313 | __u; \ |
313 | }) | 314 | }) |
@@ -321,8 +322,8 @@ static inline void put_cred(const struct cred *_cred) | |||
321 | #define get_current_groups() \ | 322 | #define get_current_groups() \ |
322 | ({ \ | 323 | ({ \ |
323 | struct group_info *__groups; \ | 324 | struct group_info *__groups; \ |
324 | struct cred *__cred; \ | 325 | const struct cred *__cred; \ |
325 | __cred = (struct cred *) current_cred(); \ | 326 | __cred = current_cred(); \ |
326 | __groups = get_group_info(__cred->group_info); \ | 327 | __groups = get_group_info(__cred->group_info); \ |
327 | __groups; \ | 328 | __groups; \ |
328 | }) | 329 | }) |
@@ -341,7 +342,7 @@ static inline void put_cred(const struct cred *_cred) | |||
341 | 342 | ||
342 | #define current_cred_xxx(xxx) \ | 343 | #define current_cred_xxx(xxx) \ |
343 | ({ \ | 344 | ({ \ |
344 | current->cred->xxx; \ | 345 | current_cred()->xxx; \ |
345 | }) | 346 | }) |
346 | 347 | ||
347 | #define current_uid() (current_cred_xxx(uid)) | 348 | #define current_uid() (current_cred_xxx(uid)) |