X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=include%2Flinux%2Fcred.h;h=98f46efbe2d21a422802d7fd7bbee06d0b993116;hp=48e82af1159b60065fd3081e46c236495c2f4ff2;hb=d20bbfab01802e195a50435940f7e4aa747c217c;hpb=5389102e231d5f06da8b2897336293db18af9d76 diff --git a/include/linux/cred.h b/include/linux/cred.h index 48e82af1159b..98f46efbe2d2 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h @@ -265,10 +265,11 @@ static inline void put_cred(const struct cred *_cred) /** * current_cred - Access the current task's subjective credentials * - * Access the subjective credentials of the current task. + * Access the subjective credentials of the current task. RCU-safe, + * since nobody else can modify it. */ #define current_cred() \ - (current->cred) + (*(__force struct cred **)¤t->cred) /** * __task_cred - Access a task's objective credentials @@ -307,7 +308,7 @@ static inline void put_cred(const struct cred *_cred) ({ \ struct user_struct *__u; \ struct cred *__cred; \ - __cred = (struct cred *) current_cred(); \ + __cred = current_cred(); \ __u = get_uid(__cred->user); \ __u; \ }) @@ -322,7 +323,7 @@ static inline void put_cred(const struct cred *_cred) ({ \ struct group_info *__groups; \ struct cred *__cred; \ - __cred = (struct cred *) current_cred(); \ + __cred = current_cred(); \ __groups = get_group_info(__cred->group_info); \ __groups; \ }) @@ -341,7 +342,7 @@ static inline void put_cred(const struct cred *_cred) #define current_cred_xxx(xxx) \ ({ \ - current->cred->xxx; \ + current_cred()->xxx; \ }) #define current_uid() (current_cred_xxx(uid))