futex: Do not apply time namespace adjustment on FUTEX_LOCK_PI
authorThomas Gleixner <tglx@linutronix.de>
Thu, 22 Apr 2021 19:44:19 +0000 (21:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:37 +0000 (14:47 +0200)
commitd19a456acaec3de1ed64952fe21974ae0cff376f
tree9e4a47d8c873db7b8f2894290a12eeec011477d3
parent2543329485e2e0aec429535fa81065495b75dae9
futex: Do not apply time namespace adjustment on FUTEX_LOCK_PI

commit cdf78db4070967869e4d027c11f4dd825d8f815a upstream.

FUTEX_LOCK_PI does not require to have the FUTEX_CLOCK_REALTIME bit set
because it has been using CLOCK_REALTIME based absolute timeouts
forever. Due to that, the time namespace adjustment which is applied when
FUTEX_CLOCK_REALTIME is not set, will wrongly take place for FUTEX_LOCK_PI
and wreckage the timeout.

Exclude it from that procedure.

Fixes: c2f7d08cccf4 ("futex: Adjust absolute futex timeouts with per time namespace offset")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210422194704.984540159@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/futex.c