[v14,1/9] nptl: initialize cpu_id_start prior to rseq registration
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
When adding explicit initialization of rseq fields prior to
registration, I glossed over the fact that 'cpu_id_start' is also
documented as initialized by user-space.
While current kernels don't validate the content of this field on
registration, future ones could.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
sysdeps/unix/sysv/linux/rseq-internal.h | 1 +
1 file changed, 1 insertion(+)
Comments
On 2024-11-21 14:08, Michael Jeanson wrote:
> When adding explicit initialization of rseq fields prior to
> registration, I glossed over the fact that 'cpu_id_start' is also
> documented as initialized by user-space.
>
> While current kernels don't validate the content of this field on
> registration, future ones could.
>
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> ---
> sysdeps/unix/sysv/linux/rseq-internal.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sysdeps/unix/sysv/linux/rseq-internal.h b/sysdeps/unix/sysv/linux/rseq-internal.h
> index 37a8f630b6..ef3eab1fef 100644
> --- a/sysdeps/unix/sysv/linux/rseq-internal.h
> +++ b/sysdeps/unix/sysv/linux/rseq-internal.h
> @@ -56,6 +56,7 @@ rseq_register_current_thread (struct pthread *self, bool do_rseq)
> registration, there is no guarantee that struct pthread is
> cleared on all architectures. */
> THREAD_SETMEM (self, rseq_area.cpu_id, RSEQ_CPU_ID_UNINITIALIZED);
> + THREAD_SETMEM (self, rseq_area.cpu_id_start, 0);
> THREAD_SETMEM (self, rseq_area.rseq_cs, 0);
> THREAD_SETMEM (self, rseq_area.flags, 0);
>
@@ -56,6 +56,7 @@ rseq_register_current_thread (struct pthread *self, bool do_rseq)
registration, there is no guarantee that struct pthread is
cleared on all architectures. */
THREAD_SETMEM (self, rseq_area.cpu_id, RSEQ_CPU_ID_UNINITIALIZED);
+ THREAD_SETMEM (self, rseq_area.cpu_id_start, 0);
THREAD_SETMEM (self, rseq_area.rseq_cs, 0);
THREAD_SETMEM (self, rseq_area.flags, 0);