diff options
author | Darren Hart <dvhart@linux.intel.com> | 2012-11-26 16:29:56 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-12-03 12:59:14 -0800 |
commit | beb93b17f27dee8a85db7bf0d882b59cdff4b2a0 (patch) | |
tree | 7b2d9f71cdb54155efb1f6375875ac4e002a9eda /net/mac80211 | |
parent | 2d7c6b713f9479a02e4a8e7159dc32ad160c8da7 (diff) | |
download | kernel_samsung_aries-beb93b17f27dee8a85db7bf0d882b59cdff4b2a0.zip kernel_samsung_aries-beb93b17f27dee8a85db7bf0d882b59cdff4b2a0.tar.gz kernel_samsung_aries-beb93b17f27dee8a85db7bf0d882b59cdff4b2a0.tar.bz2 |
futex: avoid wake_futex() for a PI futex_q
commit aa10990e028cac3d5e255711fb9fb47e00700e35 upstream.
Dave Jones reported a bug with futex_lock_pi() that his trinity test
exposed. Sometime between queue_me() and taking the q.lock_ptr, the
lock_ptr became NULL, resulting in a crash.
While futex_wake() is careful to not call wake_futex() on futex_q's with
a pi_state or an rt_waiter (which are either waiting for a
futex_unlock_pi() or a PI futex_requeue()), futex_wake_op() and
futex_requeue() do not perform the same test.
Update futex_wake_op() and futex_requeue() to test for q.pi_state and
q.rt_waiter and abort with -EINVAL if detected. To ensure any future
breakage is caught, add a WARN() to wake_futex() if the same condition
is true.
This fix has seen 3 hours of testing with "trinity -c futex" on an
x86_64 VM with 4 CPUS.
[akpm@linux-foundation.org: tidy up the WARN()]
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Reported-by: Dave Jones <davej@redat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: John Kacur <jkacur@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/mac80211')
0 files changed, 0 insertions, 0 deletions