mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2024-11-23 12:10:29 +00:00
futex: Cover all PI opcodes with cmpxchg enabled check
Some of the newer futex PI opcodes do not check the cmpxchg enabled variable and call unconditionally into the handling functions. Cover all PI opcodes in a separate check. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Cc: Peter Zijlstra <peterz@infradead.org> Cc: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
parent
f07fdec50a
commit
59263b513c
@ -2628,6 +2628,16 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
case FUTEX_LOCK_PI:
|
||||
case FUTEX_UNLOCK_PI:
|
||||
case FUTEX_TRYLOCK_PI:
|
||||
case FUTEX_WAIT_REQUEUE_PI:
|
||||
case FUTEX_CMP_REQUEUE_PI:
|
||||
if (!futex_cmpxchg_enabled)
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
case FUTEX_WAIT:
|
||||
val3 = FUTEX_BITSET_MATCH_ANY;
|
||||
@ -2649,15 +2659,12 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
|
||||
ret = futex_wake_op(uaddr, flags, uaddr2, val, val2, val3);
|
||||
break;
|
||||
case FUTEX_LOCK_PI:
|
||||
if (futex_cmpxchg_enabled)
|
||||
ret = futex_lock_pi(uaddr, flags, val, timeout, 0);
|
||||
break;
|
||||
case FUTEX_UNLOCK_PI:
|
||||
if (futex_cmpxchg_enabled)
|
||||
ret = futex_unlock_pi(uaddr, flags);
|
||||
break;
|
||||
case FUTEX_TRYLOCK_PI:
|
||||
if (futex_cmpxchg_enabled)
|
||||
ret = futex_lock_pi(uaddr, flags, 0, timeout, 1);
|
||||
break;
|
||||
case FUTEX_WAIT_REQUEUE_PI:
|
||||
|
Loading…
Reference in New Issue
Block a user