From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
Subject: [PATCH] x32: Add <fixup-asm-unistd.h> and regenerate arch-syscall.h
Date: Tue, 25 Aug 2020 05:51:29 -0700 [thread overview]
Message-ID: <CAMe9rOry6UZrBn4crSf2muPdA4TTgbBOrAwgnSsfZeMyeLNppA@mail.gmail.com> (raw)
In-Reply-To: <87sgcb80e6.fsf@oldenburg2.str.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2483 bytes --]
On Tue, Aug 25, 2020 at 3:50 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> > I am putting tools/testing/selftests/x86/sigreturn.c from Linux kernel
> > into glibc to test a new arch_prctl syscall for CET:
> >
> > ARCH_X86_CET_MMAP_SHSTK:
> >
> > /* Allocate a new shadow stack with unsigned long long *addr:
> > IN: requested shadow stack size: addr[0].
> > IN: The mmap flags: addr[1].
> > 1. MAP_32BIT
> > 2. MAP_POPULATE
> > OUT: allocated shadow stack address: *addr.
> > */
>
> This patch works for me.
>
> Thanks,
> Flroian
>
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
> index 16b768d8ba..2cd35c120b 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
> @@ -3,6 +3,8 @@ default-abi := x32
>
> ifeq ($(subdir),misc)
> sysdep_routines += arch_prctl
> +
> +tests-internal += tst-set_thread_area
> endif
>
> ifeq ($(subdir),conform)
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
> index 1a701c1472..7b64b1fa0c 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
> @@ -260,6 +260,7 @@
> #define __NR_sendto 1073741868
> #define __NR_set_mempolicy 1073742062
> #define __NR_set_robust_list 1073742354
> +#define __NR_set_thread_area 1073742029
> #define __NR_set_tid_address 1073742042
> #define __NR_setdomainname 1073741995
> #define __NR_setfsgid 1073741947
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/fixup-asm-unistd.h b/sysdeps/unix/sysv/linux/x86_64/x32/fixup-asm-unistd.h
> new file mode 100644
> index 0000000000..984f948626
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/fixup-asm-unistd.h
> @@ -0,0 +1,3 @@
> +#ifndef __NR_set_thread_area
> +# define __NR_set_thread_area 1073742029
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/tst-set_thread_area.c b/sysdeps/unix/sysv/linux/x86_64/x32/tst-set_thread_area.c
> new file mode 100644
> index 0000000000..ff2249d343
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/tst-set_thread_area.c
> @@ -0,0 +1,9 @@
> +#include <sys/syscall.h>
> +
> +static int
> +do_test (void)
> +{
> + return __NR_set_thread_area != 0;
> +}
> +
> +#include <support/test-driver.c>
>
Here is the updated patch. OK for master?
Thanks.
--
H.J.
[-- Attachment #2: 0001-x32-Add-fixup-asm-unistd.h-and-regenerate-arch-sysca.patch --]
[-- Type: application/x-patch, Size: 4614 bytes --]
next prev parent reply other threads:[~2020-08-25 12:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-15 21:31 [PATCH] x32: Add <asm/unistd_x32.h> " H.J. Lu
2020-08-24 11:17 ` Florian Weimer
2020-08-24 12:42 ` H.J. Lu
2020-08-24 13:22 ` Florian Weimer
2020-08-24 13:56 ` H.J. Lu
2020-08-24 17:17 ` Florian Weimer
2020-08-24 18:54 ` H.J. Lu
2020-08-24 19:10 ` Florian Weimer
2020-08-24 19:29 ` H.J. Lu
2020-08-25 10:50 ` Florian Weimer
2020-08-25 12:51 ` H.J. Lu [this message]
2020-08-26 9:35 ` [PATCH] x32: Add <fixup-asm-unistd.h> " Florian Weimer
2020-08-27 13:36 ` H.J. Lu
2020-08-31 12:56 ` Florian Weimer
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=CAMe9rOry6UZrBn4crSf2muPdA4TTgbBOrAwgnSsfZeMyeLNppA@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/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).