From: Michael Jeanson Date: Wed, 20 Nov 2024 19:15:42 +0000 (-0500) Subject: nptl: initialize cpu_id_start prior to rseq registration X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=314419978f9d997ca0f05157737ba371605b17b0;p=thirdparty%2Fglibc.git nptl: initialize cpu_id_start prior to rseq registration 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 Reviewed-by: Mathieu Desnoyers (cherry picked from commit d9f40387d3305d97e30a8cf8724218c42a63680a) --- diff --git a/sysdeps/unix/sysv/linux/rseq-internal.h b/sysdeps/unix/sysv/linux/rseq-internal.h index 538160b617..1aa63eca67 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);