Skip to content

Commit

Permalink
rseq: Fix rseq unregistration regression
Browse files Browse the repository at this point in the history
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: 7d5265f ("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
  • Loading branch information
Mathieu Desnoyers authored and Ingo Molnar committed Jan 21, 2025
1 parent 7d9da04 commit 40724ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/rseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 40724ec

Please sign in to comment.