Files
linux/kernel
Thomas Gleixner 5ef5ee7999 rseq: Protect event mask against membarrier IPI
[ Upstream commit 6eb350a223 ]

rseq_need_restart() reads and clears task::rseq_event_mask with preemption
disabled to guard against the scheduler.

But membarrier() uses an IPI and sets the PREEMPT bit in the event mask
from the IPI, which leaves that RMW operation unprotected.

Use guard(irq) if CONFIG_MEMBARRIER is enabled to fix that.

Fixes: 2a36ab717e ("rseq/membarrier: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: stable@vger.kernel.org
[ Applied changes to include/linux/sched.h instead of include/linux/rseq.h ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-19 16:23:21 +02:00
..
2022-09-28 09:02:20 +02:00
2024-06-27 13:46:22 +02:00
2022-09-26 10:13:13 -07:00
2023-12-20 17:00:20 +01:00
2025-06-27 11:07:41 +01:00
2023-11-28 17:06:57 +00:00
2024-10-17 15:22:28 +02:00
2025-06-04 14:40:25 +02:00
2022-02-25 09:36:06 +01:00