]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: initialize cpu_id_start prior to rseq registration
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 20 Nov 2024 19:15:42 +0000 (14:15 -0500)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 25 Nov 2024 18:42:14 +0000 (19:42 +0100)
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

index 37a8f630b6519ff04e467907969c5960e1119bd9..ef3eab1fefd4d90dc23bae54caf082beaec2e213 100644 (file)
@@ -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);