[PATCH v16 6/8] nptl: Move the rseq area to the 'extra TLS' block

Stefan Liebler stli@linux.ibm.com
Fri Jan 17 12:43:22 GMT 2025


On 16.01.25 22:28, Michael Jeanson wrote:
> On 2025-01-16 12:04, Michael Jeanson wrote:
>>> I'll have a look at linux-next and check if I can reprod on another
>>> architecture.
> 
> So the issue is indeed specific to linux-next and affects all architectures,
> the offending commit is :
> 
>  7d5265ffcd8b (rseq: Validate read-only fields under DEBUG_RSEQ config)
> 
> It's a simple logic inversion bug that breaks unregistration, Mathieu has
> already sent an updated patch. In the mean time, you can apply this to
> your kernel sources:
> 
> 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).
> 

Oh. Wow. Thanks a lot for the investigation.
I've already build a new kernel-next with this fix and unregistration
and the full testcase succeeds. (Of course tested only on s390x, but it
should fix it everywhere)

Thanks,
Stefan


More information about the Libc-alpha mailing list