mbox series

[SRU,Trusty] Trampoline stack + misc fixes

Message ID f4ac88c3-513f-3016-0d08-6da2edd19bd1@canonical.com
State New
Headers show
Series [SRU,Trusty] Trampoline stack + misc fixes | expand

Pull-request

git+ssh://git.launchpad.net/~canonical-kernel-security-team/canonical-kernel-private/+git/pti

Message

Juerg Haefliger March 5, 2018, 2:35 p.m. UTC
This is a pull request to add a trampoline stack to Trusty. In addition,
the following upstream commits are included to fix three issues found
while debugging the stack trampoline. All these issues where found
running the x86 selftests.

- x86/signal/64: Fix SS if needed when delivering a 64-bit signal
- x86/espfix/64: Stop assuming that pt_regs is on the entry stack
- x86/mm: Expand the exception table logic to allow new handling options

I've run the x86 selftests plus perf (NMI testing) in parallel for
several hours both on Intel and AMD (to force SYSCALL since AMD doesn't
support SYSENTER) hardware and didn't notice any regression. I've also
instrumented the entry/exit paths to verify that all modified code paths
are being exercised.

...Juerg


The following changes since commit 46ca20f157d905e79be6f706ccdc4d855f9c268b:

  UBUNTU: Ubuntu-3.13.0-143.192 (2018-02-27 10:40:57 +0100)

are available in the git repository at:


git+ssh://git.launchpad.net/~canonical-kernel-security-team/canonical-kernel-private/+git/pti


for you to fetch changes up to 5af781969e447b4d8aa7893b14ad8c7f699c37b2:

  UBUNTU: SAUCE: x86/mm/kaiser: Cleanup the CR3 switching macros
(2018-02-28 11:23:19 +0100)

----------------------------------------------------------------
Andy Lutomirski (3):
      x86/kvm: Rename VMX's segment access rights defines
      x86/signal/64: Fix SS if needed when delivering a 64-bit signal
      x86/espfix/64: Stop assuming that pt_regs is on the entry stack

Denys Vlasenko (1):
      include/stddef.h: Move offsetofend() from vfio.h to a generic
kernel header

Juerg Haefliger (4):
      Revert "UBUNTU: SAUCE: x86, extable: fix uaccess fixup detection"
      UBUNTU: SAUCE: x86: Ensure the emergency kernel stack is 16-bytes
aligned
      UBUNTU: SAUCE: x86/mm: Use a trampoline stack to enter/leave the
kernel
      UBUNTU: SAUCE: x86/mm/kaiser: Cleanup the CR3 switching macros

Tony Luck (1):
      x86/mm: Expand the exception table logic to allow new handling options

 Documentation/x86/exception-tables.txt |  35 ++++++
 arch/x86/ia32/ia32entry.S              |  43 ++++++-
 arch/x86/include/asm/asm.h             |  40 +++---
 arch/x86/include/asm/desc_defs.h       |  23 ++++
 arch/x86/include/asm/kaiser.h          |  48 +++++--
 arch/x86/include/asm/processor.h       |  10 ++
 arch/x86/include/asm/uaccess.h         |  16 +--
 arch/x86/include/asm/vmx.h             |  46 +++----
 arch/x86/kernel/asm-offsets_64.c       |   3 +
 arch/x86/kernel/cpu/common.c           |   6 +
 arch/x86/kernel/entry_64.S             | 222
++++++++++++++-------------------
 arch/x86/kernel/kprobes/core.c         |   2 +-
 arch/x86/kernel/process_64.c           |   2 +
 arch/x86/kernel/signal.c               |  51 +++++++-
 arch/x86/kernel/traps.c                |  44 +++++--
 arch/x86/kvm/vmx.c                     |  12 +-
 arch/x86/mm/extable.c                  | 112 +++++++++++------
 arch/x86/mm/fault.c                    |   2 +-
 include/linux/stddef.h                 |   9 ++
 include/linux/vfio.h                   |  14 ---
 kernel/fork.c                          |   6 -
 scripts/sortextable.c                  |  32 +++++
 22 files changed, 510 insertions(+), 268 deletions(-)

Comments

Juerg Haefliger March 14, 2018, 10:31 a.m. UTC | #1
The trampoline stack is not urgent and we need to push it out with
xenial first.


On 03/05/2018 03:35 PM, Juerg Haefliger wrote:
> This is a pull request to add a trampoline stack to Trusty. In addition,
> the following upstream commits are included to fix three issues found
> while debugging the stack trampoline. All these issues where found
> running the x86 selftests.
> 
> - x86/signal/64: Fix SS if needed when delivering a 64-bit signal
> - x86/espfix/64: Stop assuming that pt_regs is on the entry stack
> - x86/mm: Expand the exception table logic to allow new handling options
> 
> I've run the x86 selftests plus perf (NMI testing) in parallel for
> several hours both on Intel and AMD (to force SYSCALL since AMD doesn't
> support SYSENTER) hardware and didn't notice any regression. I've also
> instrumented the entry/exit paths to verify that all modified code paths
> are being exercised.
> 
> ...Juerg
> 
> 
> The following changes since commit 46ca20f157d905e79be6f706ccdc4d855f9c268b:
> 
>   UBUNTU: Ubuntu-3.13.0-143.192 (2018-02-27 10:40:57 +0100)
> 
> are available in the git repository at:
> 
> 
> git+ssh://git.launchpad.net/~canonical-kernel-security-team/canonical-kernel-private/+git/pti
> 
> 
> for you to fetch changes up to 5af781969e447b4d8aa7893b14ad8c7f699c37b2:
> 
>   UBUNTU: SAUCE: x86/mm/kaiser: Cleanup the CR3 switching macros
> (2018-02-28 11:23:19 +0100)
> 
> ----------------------------------------------------------------
> Andy Lutomirski (3):
>       x86/kvm: Rename VMX's segment access rights defines
>       x86/signal/64: Fix SS if needed when delivering a 64-bit signal
>       x86/espfix/64: Stop assuming that pt_regs is on the entry stack
> 
> Denys Vlasenko (1):
>       include/stddef.h: Move offsetofend() from vfio.h to a generic
> kernel header
> 
> Juerg Haefliger (4):
>       Revert "UBUNTU: SAUCE: x86, extable: fix uaccess fixup detection"
>       UBUNTU: SAUCE: x86: Ensure the emergency kernel stack is 16-bytes
> aligned
>       UBUNTU: SAUCE: x86/mm: Use a trampoline stack to enter/leave the
> kernel
>       UBUNTU: SAUCE: x86/mm/kaiser: Cleanup the CR3 switching macros
> 
> Tony Luck (1):
>       x86/mm: Expand the exception table logic to allow new handling options
> 
>  Documentation/x86/exception-tables.txt |  35 ++++++
>  arch/x86/ia32/ia32entry.S              |  43 ++++++-
>  arch/x86/include/asm/asm.h             |  40 +++---
>  arch/x86/include/asm/desc_defs.h       |  23 ++++
>  arch/x86/include/asm/kaiser.h          |  48 +++++--
>  arch/x86/include/asm/processor.h       |  10 ++
>  arch/x86/include/asm/uaccess.h         |  16 +--
>  arch/x86/include/asm/vmx.h             |  46 +++----
>  arch/x86/kernel/asm-offsets_64.c       |   3 +
>  arch/x86/kernel/cpu/common.c           |   6 +
>  arch/x86/kernel/entry_64.S             | 222
> ++++++++++++++-------------------
>  arch/x86/kernel/kprobes/core.c         |   2 +-
>  arch/x86/kernel/process_64.c           |   2 +
>  arch/x86/kernel/signal.c               |  51 +++++++-
>  arch/x86/kernel/traps.c                |  44 +++++--
>  arch/x86/kvm/vmx.c                     |  12 +-
>  arch/x86/mm/extable.c                  | 112 +++++++++++------
>  arch/x86/mm/fault.c                    |   2 +-
>  include/linux/stddef.h                 |   9 ++
>  include/linux/vfio.h                   |  14 ---
>  kernel/fork.c                          |   6 -
>  scripts/sortextable.c                  |  32 +++++
>  22 files changed, 510 insertions(+), 268 deletions(-)
>