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]
Message-ID: <478EEBE4.40400@gmail.com>
Date:	Wed, 16 Jan 2008 21:47:16 -0800
From:	John Hubbard <john.hubbard@...il.com>
To:	Pravin Nanaware <p.nanaware@...ilent.com>
CC:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: Bitops source problem

Pravin Nanaware wrote:
> Hi,
> 
> I was just going through the include file in the /usr/include/asm/bitops.h
> 
> The function description describes it as non-atomic but it seems it is not. 
> 
> static __inline__ void __change_bit(int nr, volatile void * addr)
> {
>         __asm__ __volatile__(
>                 "btcl %1,%0"
>                 :"=m" (ADDR)
>                 :"Ir" (nr));
> }
> 
> The kernel version I am using is 2.6.9-42. Is it right or am I missing something ?  
> 
> Thanks,
> Pravin
> 

The bitops.h comments are correct: the btc IA-32 instruction is only 
atomic if used with the lock prefix. The function above does not use the 
lock prefix, so it is not atomic.

thanks,
John Hubbard

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