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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 29 May 2018 20:35:58 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Mark Rutland <mark.rutland@....com>
Cc:     linux-kernel@...r.kernel.org, Boqun Feng <boqun.feng@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Will Deacon <will.deacon@....com>, Jiri Slaby <jslaby@...e.com>
Subject: Re: [PATCH 1/7] atomics/tty: add missing atomic_long_t * cast

On Tue, May 29, 2018 at 07:07:40PM +0100, Mark Rutland wrote:
> In ldsem_cmpxchg a pointer to unsigned long is passed to
> atomic_long_cmpxchg(), which expects a pointer to atomic_long_t.
> 
> In preparation for making the atomic_long_* APIs type safe, add a cast
> before passing the value to atomic_long_cmpxchg(). Similar is already
> done in ldsem_atomic_update() when it calls atomic_long_add_return().
> 
> Signed-off-by: Mark Rutland <mark.rutland@....com>
> Cc: Boqun Feng <boqun.feng@...il.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Will Deacon <will.deacon@....com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Jiri Slaby <jslaby@...e.com>
> ---
>  drivers/tty/tty_ldsem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/tty_ldsem.c b/drivers/tty/tty_ldsem.c
> index 37a91b3df980..5f8aef97973f 100644
> --- a/drivers/tty/tty_ldsem.c
> +++ b/drivers/tty/tty_ldsem.c
> @@ -86,7 +86,7 @@ static inline long ldsem_atomic_update(long delta, struct ld_semaphore *sem)
>   */
>  static inline int ldsem_cmpxchg(long *old, long new, struct ld_semaphore *sem)
>  {
> -	long tmp = atomic_long_cmpxchg(&sem->count, *old, new);
> +	long tmp = atomic_long_cmpxchg((atomic_long_t *)&sem->count, *old, new);
>  	if (tmp == *old) {
>  		*old = new;
>  		return 1;
> -- 
> 2.11.0

Acked-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ