diff options
Diffstat (limited to 'include/linux/cred.h')
-rw-r--r-- | include/linux/cred.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/include/linux/cred.h b/include/linux/cred.h index 917dc5aeb1d4..ebbed2ce6637 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -277,17 +277,13 @@ static inline void put_cred(const struct cred *_cred) | |||
277 | * @task: The task to query | 277 | * @task: The task to query |
278 | * | 278 | * |
279 | * Access the objective credentials of a task. The caller must hold the RCU | 279 | * Access the objective credentials of a task. The caller must hold the RCU |
280 | * readlock or the task must be dead and unable to change its own credentials. | 280 | * readlock. |
281 | * | 281 | * |
282 | * The result of this function should not be passed directly to get_cred(); | 282 | * The result of this function should not be passed directly to get_cred(); |
283 | * rather get_task_cred() should be used instead. | 283 | * rather get_task_cred() should be used instead. |
284 | */ | 284 | */ |
285 | #define __task_cred(task) \ | 285 | #define __task_cred(task) \ |
286 | ({ \ | 286 | rcu_dereference((task)->real_cred) |
287 | const struct task_struct *__t = (task); \ | ||
288 | rcu_dereference_check(__t->real_cred, \ | ||
289 | task_is_dead(__t)); \ | ||
290 | }) | ||
291 | 287 | ||
292 | /** | 288 | /** |
293 | * get_current_cred - Get the current task's subjective credentials | 289 | * get_current_cred - Get the current task's subjective credentials |