From a36ad700bcc7334d606ba0f89cb308b476b50190 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Thu, 31 May 2012 16:26:16 -0700 Subject: [PATCH] --- yaml --- r: 309733 b: refs/heads/master c: 43e13cc107cf6cd3c15fbe1cef849435c2223d50 h: refs/heads/master i: 309731: ea4126cc3fc0b3c25d92ca5d22aaee17b3a4bb73 v: v3 --- [refs] | 2 +- trunk/include/linux/cred.h | 10 +++------- trunk/kernel/exit.c | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 5c03ba52afdc..fca73c04df18 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9b3c98cd663750c33434572ff76ba306505eba5a +refs/heads/master: 43e13cc107cf6cd3c15fbe1cef849435c2223d50 diff --git a/trunk/include/linux/cred.h b/trunk/include/linux/cred.h index 917dc5aeb1d4..ebbed2ce6637 100644 --- a/trunk/include/linux/cred.h +++ b/trunk/include/linux/cred.h @@ -277,17 +277,13 @@ static inline void put_cred(const struct cred *_cred) * @task: The task to query * * Access the objective credentials of a task. The caller must hold the RCU - * readlock or the task must be dead and unable to change its own credentials. + * readlock. * * The result of this function should not be passed directly to get_cred(); * rather get_task_cred() should be used instead. */ -#define __task_cred(task) \ - ({ \ - const struct task_struct *__t = (task); \ - rcu_dereference_check(__t->real_cred, \ - task_is_dead(__t)); \ - }) +#define __task_cred(task) \ + rcu_dereference((task)->real_cred) /** * get_current_cred - Get the current task's subjective credentials diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 910a0716e17a..3281493ce7ad 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -1214,7 +1214,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) unsigned long state; int retval, status, traced; pid_t pid = task_pid_vnr(p); - uid_t uid = from_kuid_munged(current_user_ns(), __task_cred(p)->uid); + uid_t uid = from_kuid_munged(current_user_ns(), task_uid(p)); struct siginfo __user *infop; if (!likely(wo->wo_flags & WEXITED))