lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87k40as9jw.fsf@xmission.com>
Date:	Thu, 17 May 2012 16:54:27 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Sasha Levin <levinsasha928@...il.com>
Cc:	oleg@...hat.com, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, davej@...hat.com
Subject: Re: [PATCH] cred: use correct cred accessor with regards to rcu read lock

Sasha Levin <levinsasha928@...il.com> writes:

> Commit "userns: Convert setting and getting uid and gid system calls to use
> kuid and kgid has modified the accessors in wait_task_continued() and
> wait_task_stopped() to use __task_cred() instead of task_uid().
>
> __task_cred() assumes that we're inside a rcu read lock, which is untrue
> for these two functions.
>
> Modify it to use task_uid() instead.

Thanks applied.

Eric


> Signed-off-by: Sasha Levin <levinsasha928@...il.com>
> ---
>  kernel/exit.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/exit.c b/kernel/exit.c
> index 6818cbb..7e54635 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -1455,7 +1455,7 @@ static int wait_task_stopped(struct wait_opts *wo,
>  	if (!unlikely(wo->wo_flags & WNOWAIT))
>  		*p_code = 0;
>  
> -	uid = from_kuid_munged(current_user_ns(), __task_cred(p)->uid);
> +	uid = from_kuid_munged(current_user_ns(), task_uid(p));
>  unlock_sig:
>  	spin_unlock_irq(&p->sighand->siglock);
>  	if (!exit_code)
> @@ -1528,7 +1528,7 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p)
>  	}
>  	if (!unlikely(wo->wo_flags & WNOWAIT))
>  		p->signal->flags &= ~SIGNAL_STOP_CONTINUED;
> -	uid = from_kuid_munged(current_user_ns(), __task_cred(p)->uid);
> +	uid = from_kuid_munged(current_user_ns(), task_uid(p));
>  	spin_unlock_irq(&p->sighand->siglock);
>  
>  	pid = task_pid_vnr(p);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ