fix rcu annotations noise in cred.h

task->cred is declared as __rcu, and access to other tasks' ->cred is,
indeed, protected. Access to current->cred does not need rcu_dereference()
at all, since only the task itself can change its ->cred. sparse, of
course, has no way of knowing that...

Add force-cast in current_cred(), make current_fsuid() et.al. use it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Al Viro and committed by Linus Torvalds 32955148 7813b94a

Changed files
+6 -5
include
linux
+6 -5
include/linux/cred.h
··· 265 265 /** 266 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 271 #define current_cred() \ 271 - (current->cred) 272 + (*(__force struct cred **)&current->cred) 272 273 273 274 /** 274 275 * __task_cred - Access a task's objective credentials ··· 308 307 ({ \ 309 308 struct user_struct *__u; \ 310 309 struct cred *__cred; \ 311 - __cred = (struct cred *) current_cred(); \ 310 + __cred = current_cred(); \ 312 311 __u = get_uid(__cred->user); \ 313 312 __u; \ 314 313 }) ··· 323 322 ({ \ 324 323 struct group_info *__groups; \ 325 324 struct cred *__cred; \ 326 - __cred = (struct cred *) current_cred(); \ 325 + __cred = current_cred(); \ 327 326 __groups = get_group_info(__cred->group_info); \ 328 327 __groups; \ 329 328 }) ··· 342 341 343 342 #define current_cred_xxx(xxx) \ 344 343 ({ \ 345 - current->cred->xxx; \ 344 + current_cred()->xxx; \ 346 345 }) 347 346 348 347 #define current_uid() (current_cred_xxx(uid))