* [PATCH 1/1] x86: Add NT_X86_SHSTK note
@ 2023-12-27 14:19 Schimpe, Christina
2023-12-27 15:58 ` H.J. Lu
0 siblings, 1 reply; 4+ messages in thread
From: Schimpe, Christina @ 2023-12-27 14:19 UTC (permalink / raw)
To: binutils; +Cc: hjl.tools
Define NT_X86_SHSTK which is the note for x86 Shadow Stack (SHSTK) to
support Intel SHSTK in Linux kernel.
For now only userspace shadow stack and kernel IBT are supported by the
linux kernel. This note should be used instead of NT_X86_CET introduced
in the commit "x86: Add NT_X86_CET note", as it is outdated and only
used by old binutils versions.
---
binutils/readelf.c | 2 ++
include/elf/common.h | 3 +++
2 files changed, 5 insertions(+)
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 775106fb99c..a464692e1b7 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -20079,6 +20079,8 @@ get_note_type (Filedata * filedata, unsigned e_type)
return _("NT_X86_XSTATE (x86 XSAVE extended state)");
case NT_X86_CET:
return _("NT_X86_CET (x86 CET state)");
+ case NT_X86_SHSTK:
+ return _("NT_X86_SHSTK (x86 SHSTK state)");
case NT_S390_HIGH_GPRS:
return _("NT_S390_HIGH_GPRS (s390 upper register halves)");
case NT_S390_TIMER:
diff --git a/include/elf/common.h b/include/elf/common.h
index 244b13361e5..690d78010c4 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -645,6 +645,9 @@
/* note name must be "LINUX". */
#define NT_X86_CET 0x203 /* x86 CET state. */
/* note name must be "LINUX". */
+#define NT_X86_SHSTK 0x204 /* x86 SHSTK state. */
+ /* This replaces NT_X86_CET (0x203). */
+ /* note name must be "LINUX". */
#define NT_S390_HIGH_GPRS 0x300 /* S/390 upper halves of GPRs */
/* note name must be "LINUX". */
#define NT_S390_TIMER 0x301 /* S390 timer */
--
2.34.1
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] x86: Add NT_X86_SHSTK note
2023-12-27 14:19 [PATCH 1/1] x86: Add NT_X86_SHSTK note Schimpe, Christina
@ 2023-12-27 15:58 ` H.J. Lu
2023-12-28 15:46 ` Schimpe, Christina
0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2023-12-27 15:58 UTC (permalink / raw)
To: Schimpe, Christina; +Cc: binutils
On Wed, Dec 27, 2023 at 6:20 AM Schimpe, Christina
<christina.schimpe@intel.com> wrote:
>
> Define NT_X86_SHSTK which is the note for x86 Shadow Stack (SHSTK) to
> support Intel SHSTK in Linux kernel.
> For now only userspace shadow stack and kernel IBT are supported by the
> linux kernel. This note should be used instead of NT_X86_CET introduced
> in the commit "x86: Add NT_X86_CET note", as it is outdated and only
> used by old binutils versions.
> ---
> binutils/readelf.c | 2 ++
> include/elf/common.h | 3 +++
> 2 files changed, 5 insertions(+)
>
> diff --git a/binutils/readelf.c b/binutils/readelf.c
> index 775106fb99c..a464692e1b7 100644
> --- a/binutils/readelf.c
> +++ b/binutils/readelf.c
> @@ -20079,6 +20079,8 @@ get_note_type (Filedata * filedata, unsigned e_type)
> return _("NT_X86_XSTATE (x86 XSAVE extended state)");
> case NT_X86_CET:
> return _("NT_X86_CET (x86 CET state)");
> + case NT_X86_SHSTK:
> + return _("NT_X86_SHSTK (x86 SHSTK state)");
> case NT_S390_HIGH_GPRS:
> return _("NT_S390_HIGH_GPRS (s390 upper register halves)");
> case NT_S390_TIMER:
> diff --git a/include/elf/common.h b/include/elf/common.h
> index 244b13361e5..690d78010c4 100644
> --- a/include/elf/common.h
> +++ b/include/elf/common.h
> @@ -645,6 +645,9 @@
> /* note name must be "LINUX". */
> #define NT_X86_CET 0x203 /* x86 CET state. */
> /* note name must be "LINUX". */
> +#define NT_X86_SHSTK 0x204 /* x86 SHSTK state. */
> + /* This replaces NT_X86_CET (0x203). */
> + /* note name must be "LINUX". */
> #define NT_S390_HIGH_GPRS 0x300 /* S/390 upper halves of GPRs */
> /* note name must be "LINUX". */
> #define NT_S390_TIMER 0x301 /* S390 timer */
> --
> 2.34.1
>
>
OK.
Thanks.
--
H.J.
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 1/1] x86: Add NT_X86_SHSTK note
2023-12-27 15:58 ` H.J. Lu
@ 2023-12-28 15:46 ` Schimpe, Christina
2023-12-28 15:52 ` H.J. Lu
0 siblings, 1 reply; 4+ messages in thread
From: Schimpe, Christina @ 2023-12-28 15:46 UTC (permalink / raw)
To: H.J. Lu; +Cc: binutils
Hi H.J.,
Thank you for the review.
As this my first time contributing: Could you commit on my behalf?
BR,
Christina
> -----Original Message-----
> From: H.J. Lu <hjl.tools@gmail.com>
> Sent: Wednesday, December 27, 2023 4:59 PM
> To: Schimpe, Christina <christina.schimpe@intel.com>
> Cc: binutils@sourceware.org
> Subject: Re: [PATCH 1/1] x86: Add NT_X86_SHSTK note
>
> On Wed, Dec 27, 2023 at 6:20 AM Schimpe, Christina
> <christina.schimpe@intel.com> wrote:
> >
> > Define NT_X86_SHSTK which is the note for x86 Shadow Stack (SHSTK) to
> > support Intel SHSTK in Linux kernel.
> > For now only userspace shadow stack and kernel IBT are supported by
> > the linux kernel. This note should be used instead of NT_X86_CET
> > introduced in the commit "x86: Add NT_X86_CET note", as it is outdated
> > and only used by old binutils versions.
> > ---
> > binutils/readelf.c | 2 ++
> > include/elf/common.h | 3 +++
> > 2 files changed, 5 insertions(+)
> >
> > diff --git a/binutils/readelf.c b/binutils/readelf.c index
> > 775106fb99c..a464692e1b7 100644
> > --- a/binutils/readelf.c
> > +++ b/binutils/readelf.c
> > @@ -20079,6 +20079,8 @@ get_note_type (Filedata * filedata, unsigned
> e_type)
> > return _("NT_X86_XSTATE (x86 XSAVE extended state)");
> > case NT_X86_CET:
> > return _("NT_X86_CET (x86 CET state)");
> > + case NT_X86_SHSTK:
> > + return _("NT_X86_SHSTK (x86 SHSTK state)");
> > case NT_S390_HIGH_GPRS:
> > return _("NT_S390_HIGH_GPRS (s390 upper register halves)");
> > case NT_S390_TIMER:
> > diff --git a/include/elf/common.h b/include/elf/common.h index
> > 244b13361e5..690d78010c4 100644
> > --- a/include/elf/common.h
> > +++ b/include/elf/common.h
> > @@ -645,6 +645,9 @@
> > /* note name must be "LINUX". */
> > #define NT_X86_CET 0x203 /* x86 CET state. */
> > /* note name must be "LINUX". */
> > +#define NT_X86_SHSTK 0x204 /* x86 SHSTK state. */
> > + /* This replaces NT_X86_CET (0x203). */
> > + /* note name must be "LINUX". */
> > #define NT_S390_HIGH_GPRS 0x300 /* S/390 upper halves of
> GPRs */
> > /* note name must be "LINUX". */
> > #define NT_S390_TIMER 0x301 /* S390 timer */
> > --
> > 2.34.1
> >
> >
>
> OK.
>
> Thanks.
>
> --
> H.J.
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] x86: Add NT_X86_SHSTK note
2023-12-28 15:46 ` Schimpe, Christina
@ 2023-12-28 15:52 ` H.J. Lu
0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2023-12-28 15:52 UTC (permalink / raw)
To: Schimpe, Christina; +Cc: binutils
On Thu, Dec 28, 2023 at 7:47 AM Schimpe, Christina
<christina.schimpe@intel.com> wrote:
>
> Hi H.J.,
>
> Thank you for the review.
> As this my first time contributing: Could you commit on my behalf?
Done.
> BR,
> Christina
>
> > -----Original Message-----
> > From: H.J. Lu <hjl.tools@gmail.com>
> > Sent: Wednesday, December 27, 2023 4:59 PM
> > To: Schimpe, Christina <christina.schimpe@intel.com>
> > Cc: binutils@sourceware.org
> > Subject: Re: [PATCH 1/1] x86: Add NT_X86_SHSTK note
> >
> > On Wed, Dec 27, 2023 at 6:20 AM Schimpe, Christina
> > <christina.schimpe@intel.com> wrote:
> > >
> > > Define NT_X86_SHSTK which is the note for x86 Shadow Stack (SHSTK) to
> > > support Intel SHSTK in Linux kernel.
> > > For now only userspace shadow stack and kernel IBT are supported by
> > > the linux kernel. This note should be used instead of NT_X86_CET
> > > introduced in the commit "x86: Add NT_X86_CET note", as it is outdated
> > > and only used by old binutils versions.
> > > ---
> > > binutils/readelf.c | 2 ++
> > > include/elf/common.h | 3 +++
> > > 2 files changed, 5 insertions(+)
> > >
> > > diff --git a/binutils/readelf.c b/binutils/readelf.c index
> > > 775106fb99c..a464692e1b7 100644
> > > --- a/binutils/readelf.c
> > > +++ b/binutils/readelf.c
> > > @@ -20079,6 +20079,8 @@ get_note_type (Filedata * filedata, unsigned
> > e_type)
> > > return _("NT_X86_XSTATE (x86 XSAVE extended state)");
> > > case NT_X86_CET:
> > > return _("NT_X86_CET (x86 CET state)");
> > > + case NT_X86_SHSTK:
> > > + return _("NT_X86_SHSTK (x86 SHSTK state)");
> > > case NT_S390_HIGH_GPRS:
> > > return _("NT_S390_HIGH_GPRS (s390 upper register halves)");
> > > case NT_S390_TIMER:
> > > diff --git a/include/elf/common.h b/include/elf/common.h index
> > > 244b13361e5..690d78010c4 100644
> > > --- a/include/elf/common.h
> > > +++ b/include/elf/common.h
> > > @@ -645,6 +645,9 @@
> > > /* note name must be "LINUX". */
> > > #define NT_X86_CET 0x203 /* x86 CET state. */
> > > /* note name must be "LINUX". */
> > > +#define NT_X86_SHSTK 0x204 /* x86 SHSTK state. */
> > > + /* This replaces NT_X86_CET (0x203). */
> > > + /* note name must be "LINUX". */
> > > #define NT_S390_HIGH_GPRS 0x300 /* S/390 upper halves of
> > GPRs */
> > > /* note name must be "LINUX". */
> > > #define NT_S390_TIMER 0x301 /* S390 timer */
> > > --
> > > 2.34.1
> > >
> > >
> >
> > OK.
> >
> > Thanks.
> >
> > --
> > H.J.
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
> Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
--
H.J.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-28 15:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-27 14:19 [PATCH 1/1] x86: Add NT_X86_SHSTK note Schimpe, Christina
2023-12-27 15:58 ` H.J. Lu
2023-12-28 15:46 ` Schimpe, Christina
2023-12-28 15:52 ` H.J. Lu
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).