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]
Message-ID: <20100615130622.GQ20317@bombadil.infradead.org>
Date:	Tue, 15 Jun 2010 09:06:22 -0400
From:	Kyle McMartin <kyle@...artin.ca>
To:	tytso@....edu, Andrew Morton <akpm@...ux-foundation.org>,
	Salman <sqazi@...gle.com>, mingo@...e.hu,
	linux-kernel@...r.kernel.org, peterz@...radead.org,
	tytso@...gle.com, torvalds@...ux-foundation.org, walken@...gle.com,
	Chen Liqin <liqin.chen@...plusct.com>,
	Lennox Wu <lennox.wu@...il.com>
Subject: Re: [PATCH] Fix a race in pid generation that causes pids to be
	reused immediately.

On Tue, Jun 15, 2010 at 08:56:50AM -0400, tytso@....edu wrote:
> > I think you're probably right, as long as one sticks with 4-byte
> > scalars.  The cmpxchg-is-now-generic change snuck in under the radar
> > (mine, at least).
> 
> Hmmm, what about unsigned longs?  (Which might be 8 bytes on some
> architectures....)
> 

Longs are fine, since Linux only supports LP64 (and would need major work
to support anything else.)

The problem documented above is that on 32-bit, a 64-bit read is
non-atomic, so even if you use a hashed spinlock to protect a u64
variable on 32-bit, reads will be non-atomic, and so must take the same
lock in order to be safe. Hence, you need accessor functions.

This is what the generic atomic code does, perhaps we could add a new
API that gives us hooks to do proper hashed spinlocks on crap
architectures but falls back to simple assignment and real cmpxchg on
real platforms.

--Kyle

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