Thread (21 messages) 21 messages, 2 authors, 23d ago

Re: [patch 02/10] rseq: Protect rseq_reset() against interrupts

From: Dmitry Vyukov <dvyukov@google.com>
Date: 2026-04-29 08:22:50
Also in: lkml, regressions

On Wed, 29 Apr 2026 at 01:33, Thomas Gleixner [off-list ref] wrote:
quoted hunk ↗ jump to hunk
rseq_reset() uses memset() to clear the tasks rseq data. That's racy
against membarrier() and preemption.

Guard it with irqsave to cure this.

Fixes: faba9d250eae ("rseq: Introduce struct rseq_data")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
---
 include/linux/rseq.h |    1 +
 1 file changed, 1 insertion(+)
--- a/include/linux/rseq.h
+++ b/include/linux/rseq.h
@@ -119,6 +119,7 @@ static inline void rseq_virt_userspace_e

 static inline void rseq_reset(struct task_struct *t)
 {
+       guard(irqsave)();
This may deserve a comment for future readers, but otherwise:

Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
        memset(&t->rseq, 0, sizeof(t->rseq));
        t->rseq.ids.cpu_id = RSEQ_CPU_ID_UNINITIALIZED;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help