linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] x86: sigcontext fixes, again
@ 2015-10-26  1:25 Andy Lutomirski
  2015-10-26  1:25 ` [PATCH v2 1/4] x86/signal/64: Add a comment about sigcontext->fs and gs Andy Lutomirski
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Andy Lutomirski @ 2015-10-26  1:25 UTC (permalink / raw)
  To: x86, linux-kernel
  Cc: Brian Gerst, Denys Vlasenko, Linus Torvalds, Borislav Petkov,
	Stas Sergeev, Andy Lutomirski

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-12-29 12:32 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-26  1:25 [PATCH v2 0/4] x86: sigcontext fixes, again Andy Lutomirski
2015-10-26  1:25 ` [PATCH v2 1/4] x86/signal/64: Add a comment about sigcontext->fs and gs Andy Lutomirski
2015-10-31 15:25   ` Stas Sergeev
2015-12-07 23:23     ` Andy Lutomirski
2015-12-29 12:24       ` Stas Sergeev
2015-12-29 12:31         ` Andy Lutomirski
2015-10-26  1:25 ` [PATCH v2 2/4] x86/signal/64: Fix SS if needed when delivering a 64-bit signal Andy Lutomirski
2015-10-26  1:25 ` [PATCH v2 3/4] x86/signal/64: Re-add support for SS in the 64-bit signal context Andy Lutomirski
2015-10-31 15:18   ` Stas Sergeev
2015-10-26  1:25 ` [PATCH v2 4/4] selftests/x86: Add tests for UC_SIGCONTEXT_SS and UC_STRICT_RESTORE_SS Andy Lutomirski
2015-10-26 11:45 ` [PATCH v2 0/4] x86: sigcontext fixes, again Stas Sergeev
2015-10-27  0:52   ` Andy Lutomirski
2015-10-27 14:05     ` Stas Sergeev
2015-10-27 22:37       ` Linus Torvalds
2015-10-28  0:04         ` Toshi Kani
2015-10-28  9:53           ` Stas Sergeev
2015-10-28 16:34             ` Toshi Kani
2015-10-28 19:22               ` Toshi Kani
2015-10-28 22:51                 ` Toshi Kani
2015-10-31 11:58                   ` Stas Sergeev
2015-11-02 17:01                     ` Toshi Kani
2015-10-30 23:50       ` Andy Lutomirski

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 NNTP newsgroup(s).