[PATCH-V2:,00/24] CET: Prepare for CET enabling

Message ID 20180613153207.57232-1-hjl.tools@gmail.com
Headers show
Series
  • CET: Prepare for CET enabling
Related show

Message

H.J. Lu June 13, 2018, 3:31 p.m.
This is the first set of patches to enable CET, excluding changes which
use the new CET system calls.  The complete set of patches is available
on hjl/cet/master branch at:

https://github.com/hjl-tools/glibc/tree/hjl/cet/master

I will submit the second set of patches with the new CET system calls,
which are on Linux kernel CET branch:

https://github.com/yyu168/linux_cet

later.


H.J. Lu (24):
  x86: Rename __glibc_reserved1 to feature_1 in tcbhead_t [BZ #22563]
  x86: Support shadow stack pointer in setjmp/longjmp
  x86: Support IBT and SHSTK in Intel CET [BZ #21598]
  x86: Add _CET_ENDBR to functions in crti.S
  x86: Add _CET_ENDBR to functions in dl-tlsdesc.S
  x86-64: Add _CET_ENDBR to STRCMP_SSE42
  i386: Add _CET_ENDBR to indirect jump targets in add_n.S/sub_n.S
  x86: Update vfork to pop shadow stack
  x86_64: Use _CET_NOTRACK in strcmp.S
  x86-64: Use _CET_NOTRACK in strcpy-sse2-unaligned.S
  x86-64: Use _CET_NOTRACK in strcmp-sse42.S
  x86-64: Use _CET_NOTRACK in memcpy-ssse3-back.S
  x86-64: Use _CET_NOTRACK in memcmp-sse4.S
  x86-64: Use _CET_NOTRACK in memcpy-ssse3.S
  i386: Use _CET_NOTRACK in i686/memcmp.S
  i386: Use _CET_NOTRACK in memset-sse2.S
  i386: Use _CET_NOTRACK in memcmp-sse4.S
  i386: Use _CET_NOTRACK in memcpy-ssse3-rep.S
  i386: Use _CET_NOTRACK in memcpy-ssse3.S
  i386: Use _CET_NOTRACK in strcpy-sse2.S
  i386: Use _CET_NOTRACK in strcat-sse2.S
  i386: Use _CET_NOTRACK in memset-sse2-rep.S
  x86-64: Add endbr64 to tst-quadmod[12].S
  Intel CET: Document --enable-cet

 INSTALL                                       |  11 ++
 NEWS                                          |  10 +
 configure                                     |  11 ++
 configure.ac                                  |   6 +
 elf/dl-load.c                                 |  61 +++---
 elf/dl-open.c                                 |   4 +
 elf/rtld.c                                    |  12 ++
 manual/install.texi                           |  10 +
 nptl/pthread_create.c                         |   5 +
 sysdeps/i386/__longjmp.S                      |  78 ++++++++
 sysdeps/i386/add_n.S                          |  27 ++-
 sysdeps/i386/bsd-_setjmp.S                    |  21 ++
 sysdeps/i386/bsd-setjmp.S                     |  21 ++
 sysdeps/i386/crti.S                           |   2 +
 sysdeps/i386/dl-tlsdesc.S                     |   7 +
 sysdeps/i386/dl-trampoline.S                  |  72 +++++++
 sysdeps/i386/i686/add_n.S                     |  27 ++-
 sysdeps/i386/i686/memcmp.S                    |   4 +-
 sysdeps/i386/i686/multiarch/memcmp-sse4.S     |   4 +-
 .../i386/i686/multiarch/memcpy-ssse3-rep.S    |   8 +-
 sysdeps/i386/i686/multiarch/memcpy-ssse3.S    |   4 +-
 sysdeps/i386/i686/multiarch/memset-sse2-rep.S |   4 +-
 sysdeps/i386/i686/multiarch/memset-sse2.S     |   4 +-
 sysdeps/i386/i686/multiarch/strcat-sse2.S     |   4 +-
 sysdeps/i386/i686/multiarch/strcpy-sse2.S     |   4 +-
 sysdeps/i386/nptl/tcb-offsets.sym             |   1 +
 sysdeps/i386/nptl/tls.h                       |   5 +-
 sysdeps/i386/setjmp.S                         |  21 ++
 sysdeps/i386/sub_n.S                          |  26 ++-
 .../unix/sysv/linux/i386/____longjmp_chk.S    |  40 ++++
 sysdeps/unix/sysv/linux/i386/dl-cet.c         |  67 +++++++
 sysdeps/unix/sysv/linux/i386/dl-machine.h     |  23 +++
 sysdeps/unix/sysv/linux/i386/vfork.S          |  54 +++++
 sysdeps/unix/sysv/linux/x86/Makefile          |  43 +++-
 sysdeps/unix/sysv/linux/x86/check-cet.awk     |  53 +++++
 sysdeps/unix/sysv/linux/x86/configure         |  69 +++++++
 sysdeps/unix/sysv/linux/x86/configure.ac      |  46 +++++
 sysdeps/unix/sysv/linux/x86/dl-cet.c          | 186 ++++++++++++++++++
 sysdeps/unix/sysv/linux/x86/dl-cet.h          | 138 +++++++++++++
 sysdeps/unix/sysv/linux/x86/dl-procruntime.c  |  57 ++++++
 sysdeps/unix/sysv/linux/x86/ldsodefs.h        |  29 +++
 sysdeps/unix/sysv/linux/x86/link_map.h        |  26 +++
 sysdeps/unix/sysv/linux/x86/pthreaddef.h      |  24 +++
 .../unix/sysv/linux/x86_64/____longjmp_chk.S  |  41 ++++
 sysdeps/unix/sysv/linux/x86_64/dl-machine.h   |  27 +++
 sysdeps/unix/sysv/linux/x86_64/vfork.S        |  35 ++++
 sysdeps/x86/Makefile                          |   1 +
 sysdeps/x86/cpu-features.h                    |   5 +
 sysdeps/x86/jmp_buf-ssp.sym                   |   1 +
 sysdeps/x86/sysdep.h                          |   8 +
 sysdeps/x86_64/__longjmp.S                    |  45 +++++
 sysdeps/x86_64/crti.S                         |   2 +
 sysdeps/x86_64/dl-tlsdesc.S                   |   5 +
 sysdeps/x86_64/dl-trampoline.h                |   2 +
 sysdeps/x86_64/multiarch/memcmp-sse4.S        |   2 +-
 sysdeps/x86_64/multiarch/memcpy-ssse3-back.S  |   6 +-
 sysdeps/x86_64/multiarch/memcpy-ssse3.S       | 124 ++++++------
 sysdeps/x86_64/multiarch/strcmp-sse42.S       |   3 +-
 .../x86_64/multiarch/strcpy-sse2-unaligned.S  |   2 +-
 sysdeps/x86_64/nptl/tcb-offsets.sym           |   1 +
 sysdeps/x86_64/nptl/tls.h                     |   5 +-
 sysdeps/x86_64/setjmp.S                       |  21 ++
 sysdeps/x86_64/strcmp.S                       |   2 +-
 sysdeps/x86_64/tst-quadmod1.S                 |   6 +
 sysdeps/x86_64/tst-quadmod2.S                 |   6 +
 65 files changed, 1561 insertions(+), 118 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/i386/dl-cet.c
 create mode 100644 sysdeps/unix/sysv/linux/i386/dl-machine.h
 create mode 100644 sysdeps/unix/sysv/linux/x86/check-cet.awk
 create mode 100644 sysdeps/unix/sysv/linux/x86/configure
 create mode 100644 sysdeps/unix/sysv/linux/x86/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/x86/dl-cet.c
 create mode 100644 sysdeps/unix/sysv/linux/x86/dl-cet.h
 create mode 100644 sysdeps/unix/sysv/linux/x86/dl-procruntime.c
 create mode 100644 sysdeps/unix/sysv/linux/x86/ldsodefs.h
 create mode 100644 sysdeps/unix/sysv/linux/x86/link_map.h
 create mode 100644 sysdeps/unix/sysv/linux/x86/pthreaddef.h
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/dl-machine.h
 create mode 100644 sysdeps/x86/jmp_buf-ssp.sym

-- 
2.17.1

Comments

H.J. Lu July 2, 2018, 2:53 p.m. | #1
On Wed, Jun 13, 2018 at 8:31 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> This is the first set of patches to enable CET, excluding changes which

> use the new CET system calls.  The complete set of patches is available

> on hjl/cet/master branch at:

>

> https://github.com/hjl-tools/glibc/tree/hjl/cet/master

>

> I will submit the second set of patches with the new CET system calls,

> which are on Linux kernel CET branch:

>

> https://github.com/yyu168/linux_cet

>

> later.

>

>

> H.J. Lu (24):

>   x86: Rename __glibc_reserved1 to feature_1 in tcbhead_t [BZ #22563]

>   x86: Support shadow stack pointer in setjmp/longjmp

>   x86: Support IBT and SHSTK in Intel CET [BZ #21598]

>   x86: Add _CET_ENDBR to functions in crti.S

>   x86: Add _CET_ENDBR to functions in dl-tlsdesc.S

>   x86-64: Add _CET_ENDBR to STRCMP_SSE42

>   i386: Add _CET_ENDBR to indirect jump targets in add_n.S/sub_n.S

>   x86: Update vfork to pop shadow stack

>   x86_64: Use _CET_NOTRACK in strcmp.S

>   x86-64: Use _CET_NOTRACK in strcpy-sse2-unaligned.S

>   x86-64: Use _CET_NOTRACK in strcmp-sse42.S

>   x86-64: Use _CET_NOTRACK in memcpy-ssse3-back.S

>   x86-64: Use _CET_NOTRACK in memcmp-sse4.S

>   x86-64: Use _CET_NOTRACK in memcpy-ssse3.S

>   i386: Use _CET_NOTRACK in i686/memcmp.S

>   i386: Use _CET_NOTRACK in memset-sse2.S

>   i386: Use _CET_NOTRACK in memcmp-sse4.S

>   i386: Use _CET_NOTRACK in memcpy-ssse3-rep.S

>   i386: Use _CET_NOTRACK in memcpy-ssse3.S

>   i386: Use _CET_NOTRACK in strcpy-sse2.S

>   i386: Use _CET_NOTRACK in strcat-sse2.S

>   i386: Use _CET_NOTRACK in memset-sse2-rep.S

>   x86-64: Add endbr64 to tst-quadmod[12].S

>   Intel CET: Document --enable-cet

>

>  INSTALL                                       |  11 ++

>  NEWS                                          |  10 +

>  configure                                     |  11 ++

>  configure.ac                                  |   6 +

>  elf/dl-load.c                                 |  61 +++---

>  elf/dl-open.c                                 |   4 +

>  elf/rtld.c                                    |  12 ++

>  manual/install.texi                           |  10 +

>  nptl/pthread_create.c                         |   5 +

>  sysdeps/i386/__longjmp.S                      |  78 ++++++++

>  sysdeps/i386/add_n.S                          |  27 ++-

>  sysdeps/i386/bsd-_setjmp.S                    |  21 ++

>  sysdeps/i386/bsd-setjmp.S                     |  21 ++

>  sysdeps/i386/crti.S                           |   2 +

>  sysdeps/i386/dl-tlsdesc.S                     |   7 +

>  sysdeps/i386/dl-trampoline.S                  |  72 +++++++

>  sysdeps/i386/i686/add_n.S                     |  27 ++-

>  sysdeps/i386/i686/memcmp.S                    |   4 +-

>  sysdeps/i386/i686/multiarch/memcmp-sse4.S     |   4 +-

>  .../i386/i686/multiarch/memcpy-ssse3-rep.S    |   8 +-

>  sysdeps/i386/i686/multiarch/memcpy-ssse3.S    |   4 +-

>  sysdeps/i386/i686/multiarch/memset-sse2-rep.S |   4 +-

>  sysdeps/i386/i686/multiarch/memset-sse2.S     |   4 +-

>  sysdeps/i386/i686/multiarch/strcat-sse2.S     |   4 +-

>  sysdeps/i386/i686/multiarch/strcpy-sse2.S     |   4 +-

>  sysdeps/i386/nptl/tcb-offsets.sym             |   1 +

>  sysdeps/i386/nptl/tls.h                       |   5 +-

>  sysdeps/i386/setjmp.S                         |  21 ++

>  sysdeps/i386/sub_n.S                          |  26 ++-

>  .../unix/sysv/linux/i386/____longjmp_chk.S    |  40 ++++

>  sysdeps/unix/sysv/linux/i386/dl-cet.c         |  67 +++++++

>  sysdeps/unix/sysv/linux/i386/dl-machine.h     |  23 +++

>  sysdeps/unix/sysv/linux/i386/vfork.S          |  54 +++++

>  sysdeps/unix/sysv/linux/x86/Makefile          |  43 +++-

>  sysdeps/unix/sysv/linux/x86/check-cet.awk     |  53 +++++

>  sysdeps/unix/sysv/linux/x86/configure         |  69 +++++++

>  sysdeps/unix/sysv/linux/x86/configure.ac      |  46 +++++

>  sysdeps/unix/sysv/linux/x86/dl-cet.c          | 186 ++++++++++++++++++

>  sysdeps/unix/sysv/linux/x86/dl-cet.h          | 138 +++++++++++++

>  sysdeps/unix/sysv/linux/x86/dl-procruntime.c  |  57 ++++++

>  sysdeps/unix/sysv/linux/x86/ldsodefs.h        |  29 +++

>  sysdeps/unix/sysv/linux/x86/link_map.h        |  26 +++

>  sysdeps/unix/sysv/linux/x86/pthreaddef.h      |  24 +++

>  .../unix/sysv/linux/x86_64/____longjmp_chk.S  |  41 ++++

>  sysdeps/unix/sysv/linux/x86_64/dl-machine.h   |  27 +++

>  sysdeps/unix/sysv/linux/x86_64/vfork.S        |  35 ++++

>  sysdeps/x86/Makefile                          |   1 +

>  sysdeps/x86/cpu-features.h                    |   5 +

>  sysdeps/x86/jmp_buf-ssp.sym                   |   1 +

>  sysdeps/x86/sysdep.h                          |   8 +

>  sysdeps/x86_64/__longjmp.S                    |  45 +++++

>  sysdeps/x86_64/crti.S                         |   2 +

>  sysdeps/x86_64/dl-tlsdesc.S                   |   5 +

>  sysdeps/x86_64/dl-trampoline.h                |   2 +

>  sysdeps/x86_64/multiarch/memcmp-sse4.S        |   2 +-

>  sysdeps/x86_64/multiarch/memcpy-ssse3-back.S  |   6 +-

>  sysdeps/x86_64/multiarch/memcpy-ssse3.S       | 124 ++++++------

>  sysdeps/x86_64/multiarch/strcmp-sse42.S       |   3 +-

>  .../x86_64/multiarch/strcpy-sse2-unaligned.S  |   2 +-

>  sysdeps/x86_64/nptl/tcb-offsets.sym           |   1 +

>  sysdeps/x86_64/nptl/tls.h                     |   5 +-

>  sysdeps/x86_64/setjmp.S                       |  21 ++

>  sysdeps/x86_64/strcmp.S                       |   2 +-

>  sysdeps/x86_64/tst-quadmod1.S                 |   6 +

>  sysdeps/x86_64/tst-quadmod2.S                 |   6 +

>  65 files changed, 1561 insertions(+), 118 deletions(-)

>  create mode 100644 sysdeps/unix/sysv/linux/i386/dl-cet.c

>  create mode 100644 sysdeps/unix/sysv/linux/i386/dl-machine.h

>  create mode 100644 sysdeps/unix/sysv/linux/x86/check-cet.awk

>  create mode 100644 sysdeps/unix/sysv/linux/x86/configure

>  create mode 100644 sysdeps/unix/sysv/linux/x86/configure.ac

>  create mode 100644 sysdeps/unix/sysv/linux/x86/dl-cet.c

>  create mode 100644 sysdeps/unix/sysv/linux/x86/dl-cet.h

>  create mode 100644 sysdeps/unix/sysv/linux/x86/dl-procruntime.c

>  create mode 100644 sysdeps/unix/sysv/linux/x86/ldsodefs.h

>  create mode 100644 sysdeps/unix/sysv/linux/x86/link_map.h

>  create mode 100644 sysdeps/unix/sysv/linux/x86/pthreaddef.h

>  create mode 100644 sysdeps/unix/sysv/linux/x86_64/dl-machine.h

>  create mode 100644 sysdeps/x86/jmp_buf-ssp.sym

>

> --

> 2.17.1

>


PING.


-- 
H.J.