Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334959 > unrolled thread

[PATCH v4 0/4] x86: sigcontext fixes, again

Started byAndy Lutomirski <luto@kernel.org>
First post2016-02-16 03:40 +0100
Last post2016-02-16 11:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v4 0/4] x86: sigcontext fixes, again Andy Lutomirski <luto@kernel.org> - 2016-02-16 03:40 +0100
    Re: [PATCH v4 0/4] x86: sigcontext fixes, again Borislav Petkov <bp@alien8.de> - 2016-02-16 11:30 +0100

#1334959 — [PATCH v4 0/4] x86: sigcontext fixes, again

FromAndy Lutomirski <luto@kernel.org>
Date2016-02-16 03:40 +0100
Subject[PATCH v4 0/4] x86: sigcontext fixes, again
Message-ID<r2DIt-1p3-3@gated-at.bofh.it>
This is take 2 at fixing x86 64-bit signals wrt SS.  After a lot of
thought, this is not controlled by any flags -- I would much prefer
to avoid opt-in behavior.  Instead, it just tries hard to avoid
triggering the cases that break DOSEMU.

Stas, this now seems to pass the test you sent me.  It works with
stock dosemu2 (I haven't tested classic dosemu because I can't get it
to work regardless).  It also works with a patched dosemu2 that bypasses
the userspace trampoline:

https://github.com/amluto/dosemu2/commit/571b4d08dc885b7a133e444a2ad23e0d21366206

With this applied, all of the x86 selftests pass on x86_64.  That
wasn't the case before -- ldt_gdt_64 was broken.

This is a bit risky, and another option would be to do nothing at
all.  Then we'd disable the problematic self-tests (sigh), and
DOSEMU and similar tools will be stuck using gross hacks even on new
kernels.

Changes from v3:
 - Comment fixes from Borislav.
 - Improve AR_xyz comments to better match SDM.  (Borislav, is this good?)
 - Get rid of duplicate AR_xyz defines in the selftest.
 - (no non-comment code changes)

Changes from v2:
 - Rebased (which wasn't quite trivial since the headers were rearranged)
 - Slightly improved a comment in patch 1.
 - Tidy up changelogs a bit.

Changes from v1:
 - Comment fixes
 - Fix screwed up uaccess that broke things

Andy Lutomirski (4):
  x86/signal/64: Add a comment about sigcontext->fs and gs
  x86/signal/64: Fix SS if needed when delivering a 64-bit signal
  x86/signal/64: Re-add support for SS in the 64-bit signal context
  selftests/x86: Add tests for UC_SIGCONTEXT_SS and UC_STRICT_RESTORE_SS

 arch/x86/include/asm/desc_defs.h        |  23 ++++
 arch/x86/include/asm/sighandling.h      |   1 -
 arch/x86/include/uapi/asm/sigcontext.h  |  26 +++-
 arch/x86/include/uapi/asm/ucontext.h    |  54 +++++++-
 arch/x86/kernel/signal.c                | 114 +++++++++++++---
 tools/testing/selftests/x86/Makefile    |   7 +-
 tools/testing/selftests/x86/sigreturn.c | 222 ++++++++++++++++++++++++++++----
 7 files changed, 387 insertions(+), 60 deletions(-)

-- 
2.5.0

[toc] | [next] | [standalone]


#1335257

FromBorislav Petkov <bp@alien8.de>
Date2016-02-16 11:30 +0100
Message-ID<r2L3l-6zR-21@gated-at.bofh.it>
In reply to#1334959
On Mon, Feb 15, 2016 at 06:38:12PM -0800, Andy Lutomirski wrote:
> This is take 2 at fixing x86 64-bit signals wrt SS.  After a lot of
> thought, this is not controlled by any flags -- I would much prefer
> to avoid opt-in behavior.  Instead, it just tries hard to avoid
> triggering the cases that break DOSEMU.
> 
> Stas, this now seems to pass the test you sent me.  It works with
> stock dosemu2 (I haven't tested classic dosemu because I can't get it
> to work regardless).  It also works with a patched dosemu2 that bypasses
> the userspace trampoline:
> 
> https://github.com/amluto/dosemu2/commit/571b4d08dc885b7a133e444a2ad23e0d21366206
> 
> With this applied, all of the x86 selftests pass on x86_64.  That
> wasn't the case before -- ldt_gdt_64 was broken.
> 
> This is a bit risky, and another option would be to do nothing at
> all.  Then we'd disable the problematic self-tests (sigh), and
> DOSEMU and similar tools will be stuck using gross hacks even on new
> kernels.
> 
> Changes from v3:
>  - Comment fixes from Borislav.
>  - Improve AR_xyz comments to better match SDM.  (Borislav, is this good?)

Yep, nice.

Thanks!

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web