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: <20120212174133.GL3737@linux.vnet.ibm.com>
Date:	Sun, 12 Feb 2012 09:41:33 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Borislav Petkov <bp@...64.org>
Cc:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
	tony.luck@...el.com, tglx@...utronix.de, mingo@...e.hu,
	hpa@...or.com, x86@...nel.org, linux-edac@...r.kernel.org,
	linux-kernel@...r.kernel.org, marcos.mage@...il.com,
	prasad@...ux.vnet.ibm.com
Subject: Re: [PATCH] x86, mce: Fix rcu splat in drain_mce_log_buffer()

On Mon, Feb 06, 2012 at 05:18:02PM +0100, Borislav Petkov wrote:
> On Fri, Jan 13, 2012 at 01:44:35PM -0800, Paul E. McKenney wrote:
> > Looks good to me, but I do need to defer to people who know this code
> > better than do I.  The key thing that (from what I can see) makes
> > rcu_dereference() unnecessary is that the smp_rmb() used in conjunction
> > with polling the .finished field takes care of ordering.
> 
> Right, this was me trying hard not to screw up touching mcelog.next,
> thus trying to use the rcu_dereference_index_check() primitive without
> thinking it through too much. But you're right, I'm polling the
> ->finished field 4 times (totally arbitrary, btw) which should suffice
> while the mce_log() routine above writes those entries.
> 
> Although, the question still remains, since mce_log() accesses
> mcelog.next through the rcu_dereference_index_check() primitive,
> shouldn't I do it the same way?

I don't claim to be an mce_log() expert, but when I looked it over,
I didn't see a need for rcu_dereference_index_check().  Unless I am
confused (quite possible), the memory barriers are sufficient.

The rcu_read_lock() and rcu_read_unlock() seem to be needed to avoid
premature freeing, though.

							Thanx, Paul

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