From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id CF5923858D37 for ; Mon, 13 Jul 2020 19:34:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CF5923858D37 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 79C212A5162; Mon, 13 Jul 2020 15:34:51 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id cRjZYDCY8lVu; Mon, 13 Jul 2020 15:34:51 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 4BB8B2A5049; Mon, 13 Jul 2020 15:34:51 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 4BB8B2A5049 X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7Jzw3SUSKd5m; Mon, 13 Jul 2020 15:34:51 -0400 (EDT) Received: from localhost.localdomain (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by mail.efficios.com (Postfix) with ESMTPSA id DEC632A4CA9; Mon, 13 Jul 2020 15:34:50 -0400 (EDT) From: Mathieu Desnoyers To: Florian Weimer Cc: Carlos O'Donell , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Mathieu Desnoyers Subject: [RFC PATCH glibc] Linux: Use fixed rseq_len value for rseq registration Date: Mon, 13 Jul 2020 15:34:34 -0400 Message-Id: <20200713193434.30440-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-15.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2020 19:34:53 -0000 The rseq registration system call expects a fixed-size argument of 32 for the rseq_len. We are currently discussing schemes to extend struct rseq beyond that size, and those involve using fields within struct rseq, without any changes to the rseq_len argument. Building a glibc with an updated, larger, struct rseq in the Linux kernel UAPI headers should not break registration. Therefore, use a fixed-size of 32 as rseq_len parameter. See struct rseq extension discussion: https://lore.kernel.org/lkml/1305865358.10354.1594665620975.JavaMail.zimbra@efficios.com/ --- sysdeps/unix/sysv/linux/rseq-internal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/rseq-internal.h b/sysdeps/unix/sysv/linux/rseq-internal.h index 8f6772ca1d..3522668f3a 100644 --- a/sysdeps/unix/sysv/linux/rseq-internal.h +++ b/sysdeps/unix/sysv/linux/rseq-internal.h @@ -33,8 +33,9 @@ rseq_register_current_thread (void) if (__rseq_abi.cpu_id != RSEQ_CPU_ID_UNINITIALIZED) __libc_fatal ("glibc fatal error: " "rseq already initialized for this thread\n"); - ret = INTERNAL_SYSCALL_CALL (rseq, &__rseq_abi, sizeof (struct rseq), - 0, RSEQ_SIG); + /* The rseq_len parameter does not allow extending struct rseq. Fix its + value to 32 as expected by the Linux kernel. */ + ret = INTERNAL_SYSCALL_CALL (rseq, &__rseq_abi, 32, 0, RSEQ_SIG); if (INTERNAL_SYSCALL_ERROR_P (ret)) { const char *msg = NULL; -- 2.17.1