diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-06-11 22:45:38 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-21 22:26:23 +0200 |
commit | ccf9e6a80d9e1b9df69c98e6b9745cf49869ee15 (patch) | |
tree | 37da57e39262f0852466b62930dcbc005ce1800b /drivers/hwmon/tmp421.c | |
parent | rtmutex: Avoid pointless requeueing in the deadlock detection chain walk (diff) | |
download | linux-ccf9e6a80d9e1b9df69c98e6b9745cf49869ee15.tar.xz linux-ccf9e6a80d9e1b9df69c98e6b9745cf49869ee15.zip |
futex: Make unlock_pi more robust
The kernel tries to atomically unlock the futex without checking
whether there is kernel state associated to the futex.
So if user space manipulated the user space value, this will leave
kernel internal state around associated to the owner task.
For robustness sake, lookup first whether there are waiters on the
futex. If there are waiters, wake the top priority waiter with all the
proper sanity checks applied.
If there are no waiters, do the atomic release. We do not have to
preserve the waiters bit in this case, because a potentially incoming
waiter is blocked on the hb->lock and will acquire the futex
atomically. We neither have to preserve the owner died bit. The caller
is the owner and it was supposed to cleanup the mess.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <darren@dvhart.com>
Cc: Davidlohr Bueso <davidlohr@hp.com>
Cc: Kees Cook <kees@outflux.net>
Cc: wad@chromium.org
Link: http://lkml.kernel.org/r/20140611204237.016987332@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/hwmon/tmp421.c')
0 files changed, 0 insertions, 0 deletions