[PATCH] Add compiler barriers around modifications of the robust mutex list.

Torvald Riegel triegel@redhat.com
Fri Dec 23 23:57:00 GMT 2016


This fixes a latent bug in the robust mutexes: We need to enforce that
the kernel sees a consistent state of the robust list (and everything
else related) after a potential crash.  This means we need to treat this
similar to synchronization with a signal handler.
See the patch for details.

I'm saying that this is a latent bug because at least on x86_64, the
compiler seems to generate code that works currently.  There's no
general guarantee to that though, hence the "hardening" in this patch.

Like the other patches I sent before, this is supposed to be easily
backport-able.  In a follow-up cleanup, I'll add a signal fence and use
relaxed MO atomics for all relevant accesses to the robust mutex list.

Tested on x86_64-linux.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: robust-mutex-barriers.patch
Type: text/x-patch
Size: 17259 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20161223/2519026c/attachment.bin>


More information about the Libc-alpha mailing list