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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 Aug 2014 09:04:19 +1000
From:	Ryan Mallon <rmallon@...il.com>
To:	Sanjeev Sharma <sanjeev_sharma@...tor.com>, cpw@....com,
	robinmholt@...il.com
CC:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sgi-xp: Do not use BUG_ON(!spin_is_locked())

On 12/08/14 17:35, Sanjeev Sharma wrote:
> on some architecture spin_is_locked() always return false in
> uniprocessor configuration and can therefore not be used
> with BUG_ON.it would be advise to replace with
> lockdep_assert_held().
> 
> Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@...tor.com>
> ---
>  drivers/misc/sgi-xp/xpc_channel.c | 6 +++---
>  drivers/misc/sgi-xp/xpc_sn2.c     | 2 +-
>  drivers/misc/sgi-xp/xpc_uv.c      | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/misc/sgi-xp/xpc_channel.c b/drivers/misc/sgi-xp/xpc_channel.c
> index 128d561..240fe5a 100644
> --- a/drivers/misc/sgi-xp/xpc_channel.c
> +++ b/drivers/misc/sgi-xp/xpc_channel.c
> @@ -28,7 +28,7 @@ xpc_process_connect(struct xpc_channel *ch, unsigned long *irq_flags)
>  {
>  	enum xp_retval ret;
>  
> -	DBUG_ON(!spin_is_locked(&ch->lock));
> +	lockdep_assert_held(!spin_is_locked(&ch->lock));

This is incorrect, and will break the build with CONFIG_LOCKDEP enabled.
You actually want:

	lockdep_assert_held(&ch->lock);

Same for the other instances.

~Ryan
--
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