Merge tag 'core-rseq-2025-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull rseq updates from Thomas Gleixner:
"Two fixes for RSEQ:
- Protect the event mask modification against the membarrier() IPI as
otherwise the RmW operation is unprotected and events might be lost
- Fix the weak symbol reference in rseq selftests
The current weak RSEQ symbols definitions which were added to allow
static linkage are not working correctly as they effectively
re-define the glibc symbols leading to multiple versions of the
symbols when compiled with -fno-common.
Mark them as 'extern' to convert them from weak symbol definitions
to weak symbol references. That works with static and dynamic
linkage independent of -fcommon and -fno-common"
* tag 'core-rseq-2025-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
rseq/selftests: Use weak symbol reference, not definition, to link with glibc
rseq: Protect event mask against membarrier IPI
This commit is contained in:
+5
-5
@@ -342,12 +342,12 @@ static int rseq_need_restart(struct task_struct *t, u32 cs_flags)
|
||||
|
||||
/*
|
||||
* Load and clear event mask atomically with respect to
|
||||
* scheduler preemption.
|
||||
* scheduler preemption and membarrier IPIs.
|
||||
*/
|
||||
preempt_disable();
|
||||
event_mask = t->rseq_event_mask;
|
||||
t->rseq_event_mask = 0;
|
||||
preempt_enable();
|
||||
scoped_guard(RSEQ_EVENT_GUARD) {
|
||||
event_mask = t->rseq_event_mask;
|
||||
t->rseq_event_mask = 0;
|
||||
}
|
||||
|
||||
return !!event_mask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user