Re: futex breakage in 4.9 stable branch

From: Thomas Gleixner
Date: Thu Mar 04 2021 - 13:49:08 EST


On Thu, Mar 04 2021 at 10:12, Mike Galbraith wrote:
> On Mon, 2021-03-01 at 18:29 +0100, Ben Hutchings wrote:
>
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -874,8 +874,12 @@ static void free_pi_state(struct futex_p
> * and has cleaned up the pi_state already
> */
> if (pi_state->owner) {
> + unsigned long flags;
> +
> + raw_spin_lock_irqsave(&pi_state->pi_mutex.wait_lock, flags);
> pi_state_update_owner(pi_state, NULL);
> rt_mutex_proxy_unlock(&pi_state->pi_mutex);
> + raw_spin_unlock_irqrestore(&pi_state->pi_mutex.wait_lock, flags);

This hunk is missing in 4.9 as well.

> }
>
> if (current->pi_state_cache)
> @@ -1406,7 +1410,7 @@ static int wake_futex_pi(u32 __user *uad
> if (pi_state->owner != current)
> return -EINVAL;
>
> - raw_spin_lock(&pi_state->pi_mutex.wait_lock);
> + raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock);
> new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
>
> /*

That looks correct.

Thanks,

tglx