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: <1244204320.13761.4302.camel@twins>
Date:	Fri, 05 Jun 2009 14:18:40 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Paul Mackerras <paulus@...ba.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: Code atomic[64]_read and atomic[64]_set in C not
 CPP

On Fri, 2009-06-05 at 20:43 +1000, Paul Mackerras wrote:
> Occasionally we get bugs where atomic_read or atomic_set are used on
> atomic64_t variables or vice versa.  These bugs don't generate
> warnings on x86 because atomic_read and atomic_set are coded as macros
> rather than C functions, so we don't get any type-checking on their
> arguments; similarly for atomic64_read and atomic64_set in 64-bit
> kernels.
> 
> This converts them to C functions so that the arguments are
> type-checked and bugs like this will get caught more easily.
> It also converts atomic_cmpxchg and atomic_xchg, and atomic64_cmpxchg
> and atomic64_xchg on 64-bit, so we get type-checking on their
> arguments too.
> 
> Compiling a typical 64-bit x86 config, this generates no new warnings,
> and the vmlinux text is 86 bytes smaller.
> 
> Signed-off-by: Paul Mackerras <paulus@...ba.org>

Nice!

Acked-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
--
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