public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>,
	Joseph Myers <joseph@codesourcery.com>,
	Szabolcs Nagy <szabolcs.nagy@arm.com>,
	libc-alpha@sourceware.org,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: [RFC PATCH glibc] Linux: Use fixed rseq_len value for rseq registration
Date: Mon, 13 Jul 2020 15:34:34 -0400	[thread overview]
Message-ID: <20200713193434.30440-1-mathieu.desnoyers@efficios.com> (raw)

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


             reply	other threads:[~2020-07-13 19:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 19:34 Mathieu Desnoyers [this message]
2020-07-14  8:51 ` Florian Weimer
2020-07-14 12:31   ` Mathieu Desnoyers
2020-07-14 13:28     ` Florian Weimer
2020-07-14 13:33       ` Christian Brauner
2020-07-14 13:54         ` Florian Weimer
2020-07-14 14:04           ` Mathieu Desnoyers
2020-07-14 15:07             ` Florian Weimer
2020-07-14 15:30               ` Mathieu Desnoyers
2020-07-14 16:01                 ` Szabolcs Nagy
2020-07-14 16:12                   ` Mathieu Desnoyers
2020-07-14 17:03                     ` Florian Weimer
2020-07-14 17:12                       ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200713193434.30440-1-mathieu.desnoyers@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=szabolcs.nagy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).