* [PATCH for sched/core] rseq: Fix rseq unregistration
@ 2025-01-16 20:59 Mathieu Desnoyers
2025-01-20 16:49 ` Mathieu Desnoyers
2025-01-21 7:24 ` [tip: sched/core] rseq: Fix rseq unregistration regression tip-bot2 for Mathieu Desnoyers
0 siblings, 2 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2025-01-16 20:59 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: linux-kernel, Mathieu Desnoyers
A logic inversion in rseq_reset_rseq_cpu_node_id() causes the rseq
unregistration to fail when rseq_validate_ro_fields() succeeds rather
than the opposite.
This affects both CONFIG_DEBUG_RSEQ=y and CONFIG_DEBUG_RSEQ=n.
Fixes: 7d5265ffcd8b ("rseq: Validate read-only fields under DEBUG_RSEQ config")
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
---
kernel/rseq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rseq.c b/kernel/rseq.c
index e04bb30a2eb8..442aba29bc4c 100644
--- a/kernel/rseq.c
+++ b/kernel/rseq.c
@@ -201,7 +201,7 @@ static int rseq_reset_rseq_cpu_node_id(struct task_struct *t)
/*
* Validate read-only rseq fields.
*/
- if (!rseq_validate_ro_fields(t))
+ if (rseq_validate_ro_fields(t))
return -EFAULT;
/*
* Reset cpu_id_start to its initial state (0).
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for sched/core] rseq: Fix rseq unregistration
2025-01-16 20:59 [PATCH for sched/core] rseq: Fix rseq unregistration Mathieu Desnoyers
@ 2025-01-20 16:49 ` Mathieu Desnoyers
2025-01-21 7:24 ` [tip: sched/core] rseq: Fix rseq unregistration regression tip-bot2 for Mathieu Desnoyers
1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2025-01-20 16:49 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar; +Cc: linux-kernel
On 2025-01-16 15:59, Mathieu Desnoyers wrote:
> A logic inversion in rseq_reset_rseq_cpu_node_id() causes the rseq
> unregistration to fail when rseq_validate_ro_fields() succeeds rather
> than the opposite.
>
> This affects both CONFIG_DEBUG_RSEQ=y and CONFIG_DEBUG_RSEQ=n.
>
> Fixes: 7d5265ffcd8b ("rseq: Validate read-only fields under DEBUG_RSEQ config")
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Ingo, Peter, this fix should have been part of the PR sent to Linus
earlier today [1]. Otherwise rseq unregistration is broken.
Thanks,
Mathieu
[1] https://lore.kernel.org/lkml/Z44ufdYZWaM50kxF@gmail.com/
> ---
> kernel/rseq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/rseq.c b/kernel/rseq.c
> index e04bb30a2eb8..442aba29bc4c 100644
> --- a/kernel/rseq.c
> +++ b/kernel/rseq.c
> @@ -201,7 +201,7 @@ static int rseq_reset_rseq_cpu_node_id(struct task_struct *t)
> /*
> * Validate read-only rseq fields.
> */
> - if (!rseq_validate_ro_fields(t))
> + if (rseq_validate_ro_fields(t))
> return -EFAULT;
> /*
> * Reset cpu_id_start to its initial state (0).
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip: sched/core] rseq: Fix rseq unregistration regression
2025-01-16 20:59 [PATCH for sched/core] rseq: Fix rseq unregistration Mathieu Desnoyers
2025-01-20 16:49 ` Mathieu Desnoyers
@ 2025-01-21 7:24 ` tip-bot2 for Mathieu Desnoyers
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Mathieu Desnoyers @ 2025-01-21 7:24 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Mathieu Desnoyers, Ingo Molnar, x86, linux-kernel
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 40724ecafccb1fb62b66264854e8c3ad394c8f3d
Gitweb: https://git.kernel.org/tip/40724ecafccb1fb62b66264854e8c3ad394c8f3d
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
AuthorDate: Thu, 16 Jan 2025 15:59:56 -05:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 21 Jan 2025 08:10:51 +01:00
rseq: Fix rseq unregistration regression
A logic inversion in rseq_reset_rseq_cpu_node_id() causes the rseq
unregistration to fail when rseq_validate_ro_fields() succeeds rather
than the opposite.
This affects both CONFIG_DEBUG_RSEQ=y and CONFIG_DEBUG_RSEQ=n.
Fixes: 7d5265ffcd8b ("rseq: Validate read-only fields under DEBUG_RSEQ config")
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250116205956.836074-1-mathieu.desnoyers@efficios.com
---
kernel/rseq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rseq.c b/kernel/rseq.c
index e04bb30..442aba2 100644
--- a/kernel/rseq.c
+++ b/kernel/rseq.c
@@ -201,7 +201,7 @@ static int rseq_reset_rseq_cpu_node_id(struct task_struct *t)
/*
* Validate read-only rseq fields.
*/
- if (!rseq_validate_ro_fields(t))
+ if (rseq_validate_ro_fields(t))
return -EFAULT;
/*
* Reset cpu_id_start to its initial state (0).
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-21 7:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-16 20:59 [PATCH for sched/core] rseq: Fix rseq unregistration Mathieu Desnoyers
2025-01-20 16:49 ` Mathieu Desnoyers
2025-01-21 7:24 ` [tip: sched/core] rseq: Fix rseq unregistration regression tip-bot2 for Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®