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


Groups > linux.kernel > #1255608

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

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v2 0/4] x86: sigcontext fixes, again
Date 2015-10-26 02:30 +0100
Message-ID <qnELL-1Sy-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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 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/sigcontext.h       |   2 +-
 arch/x86/include/asm/sighandling.h      |   1 -
 arch/x86/include/uapi/asm/sigcontext.h  |  23 ++-
 arch/x86/include/uapi/asm/ucontext.h    |  43 +++++-
 arch/x86/kernel/signal.c                | 114 ++++++++++++---
 tools/testing/selftests/x86/Makefile    |   4 +-
 tools/testing/selftests/x86/sigreturn.c | 240 ++++++++++++++++++++++++++++----
 8 files changed, 391 insertions(+), 59 deletions(-)

-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/4] x86: sigcontext fixes, again Andy Lutomirski <luto@kernel.org> - 2015-10-26 02:30 +0100
  [PATCH v2 2/4] x86/signal/64: Fix SS if needed when delivering a 64-bit signal Andy Lutomirski <luto@kernel.org> - 2015-10-26 02:30 +0100
  [PATCH v2 1/4] x86/signal/64: Add a comment about sigcontext->fs and gs Andy Lutomirski <luto@kernel.org> - 2015-10-26 02:30 +0100
  [PATCH v2 3/4] x86/signal/64: Re-add support for SS in the 64-bit signal context Andy Lutomirski <luto@kernel.org> - 2015-10-26 02:30 +0100
  [PATCH v2 4/4] selftests/x86: Add tests for UC_SIGCONTEXT_SS and UC_STRICT_RESTORE_SS Andy Lutomirski <luto@kernel.org> - 2015-10-26 02:30 +0100
  Re: [PATCH v2 0/4] x86: sigcontext fixes, again Stas Sergeev <stsp@list.ru> - 2015-10-26 12:50 +0100
    Re: [PATCH v2 0/4] x86: sigcontext fixes, again Andy Lutomirski <luto@amacapital.net> - 2015-10-27 02:00 +0100
      Re: [PATCH v2 0/4] x86: sigcontext fixes, again Linus Torvalds <torvalds@linux-foundation.org> - 2015-10-27 23:40 +0100
        Re: [PATCH v2 0/4] x86: sigcontext fixes, again Toshi Kani <toshi.kani@hpe.com> - 2015-10-28 01:10 +0100
          Re: [PATCH v2 0/4] x86: sigcontext fixes, again Stas Sergeev <stsp@list.ru> - 2015-10-28 11:00 +0100
            Re: [PATCH v2 0/4] x86: sigcontext fixes, again Toshi Kani <toshi.kani@hpe.com> - 2015-10-28 17:40 +0100
              Re: [PATCH v2 0/4] x86: sigcontext fixes, again Toshi Kani <toshi.kani@hpe.com> - 2015-10-28 20:30 +0100
                Re: [PATCH v2 0/4] x86: sigcontext fixes, again Toshi Kani <toshi.kani@hpe.com> - 2015-10-29 00:00 +0100
                Re: [PATCH v2 0/4] x86: sigcontext fixes, again Stas Sergeev <stsp@list.ru> - 2015-10-31 13:50 +0100
      Re: [PATCH v2 0/4] x86: sigcontext fixes, again Andy Lutomirski <luto@amacapital.net> - 2015-10-31 01:00 +0100

csiph-web