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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 8 Aug 2011 07:35:24 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	David Howells <dhowells@...hat.com>
Cc:	Al Viro <viro@...IV.linux.org.uk>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: fix rcu annotations noise in cred.h

On Mon, Aug 08, 2011 at 01:54:08PM +0100, David Howells wrote:
> Paul E. McKenney <paulmck@...ux.vnet.ibm.com> wrote:
> 
> > This is indeed what rcu_dereference_protected() is intended for.
> 
> How about the attached patch?
> 
> David
> ---
> From: David Howells <dhowells@...hat.com>
> Subject: [PATCH] CRED: Restore const to current_cred()
> 
> Commit 3295514841c2112d94451ba5deaf54f5afb78ea9 accidentally dropped the const
> of current->cred inside current_cred() by the insertion of a cast to deal with
> an RCU annotation loss warning from sparce.
> 
> Use an appropriate RCU wrapper instead so as not to lose the const.

Reviewed-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>

> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Al Viro <viro@...iv.linux.org.uk>
> ---
> 
>  include/linux/cred.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> 
> diff --git a/include/linux/cred.h b/include/linux/cred.h
> index 98f46ef..8e2fd44 100644
> --- a/include/linux/cred.h
> +++ b/include/linux/cred.h
> @@ -269,7 +269,7 @@ static inline void put_cred(const struct cred *_cred)
>   * since nobody else can modify it.
>   */
>  #define current_cred() \
> -	(*(__force struct cred **)&current->cred)
> +	rcu_dereference_protected(current->cred, 1)
> 
>  /**
>   * __task_cred - Access a task's objective credentials
--
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