public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/4] x86: sigcontext SS fixes, take 2
@ 2015-10-13  1:04 Andy Lutomirski
  2015-10-13  1:04 ` [RFC 1/4] x86/signal/64: Add a comment about sigcontext->fs and gs Andy Lutomirski
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Andy Lutomirski @ 2015-10-13  1:04 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, what do you think?  Could you test this?  It applies on top of
tip:x86/asm.  You can also find it at
https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=x86/sigcontext&id=fd69bc4e6095d6a7cf2a0f03e69bace025505132

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.

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    |  41 +++++-
 arch/x86/kernel/signal.c                | 115 ++++++++++++---
 tools/testing/selftests/x86/Makefile    |   4 +-
 tools/testing/selftests/x86/sigreturn.c | 240 ++++++++++++++++++++++++++++----
 8 files changed, 389 insertions(+), 60 deletions(-)

-- 
2.4.3


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

end of thread, other threads:[~2015-10-18 17:06 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13  1:04 [RFC 0/4] x86: sigcontext SS fixes, take 2 Andy Lutomirski
2015-10-13  1:04 ` [RFC 1/4] x86/signal/64: Add a comment about sigcontext->fs and gs Andy Lutomirski
2015-10-13  1:04 ` [RFC 2/4] x86/signal/64: Fix SS if needed when delivering a 64-bit signal Andy Lutomirski
2015-10-13  1:04 ` [RFC 3/4] x86/signal/64: Re-add support for SS in the 64-bit signal context Andy Lutomirski
2015-10-13 14:59   ` Stas Sergeev
2015-10-14 15:01     ` Ingo Molnar
2015-10-14 15:09       ` Stas Sergeev
2015-10-14 16:40     ` Andy Lutomirski
2015-10-14 17:40       ` Stas Sergeev
2015-10-14 18:06         ` Andy Lutomirski
2015-10-14 18:34           ` Stas Sergeev
2015-10-14 18:52             ` Andy Lutomirski
2015-10-14 21:37               ` Stas Sergeev
2015-10-14 21:41                 ` Andy Lutomirski
2015-10-18 13:36                   ` Stas Sergeev
2015-10-18 16:12                     ` Andy Lutomirski
2015-10-18 16:29                       ` Stas Sergeev
2015-10-18 16:36                         ` Andy Lutomirski
2015-10-18 16:43                           ` Stas Sergeev
2015-10-18 17:06                             ` Andy Lutomirski
2015-10-14 16:40   ` Cyrill Gorcunov
2015-10-14 16:42     ` Andy Lutomirski
2015-10-14 16:57       ` Cyrill Gorcunov
2015-10-14 16:57     ` Stas Sergeev
2015-10-14 17:01       ` Cyrill Gorcunov
2015-10-13  1:04 ` [RFC 4/4] selftests/x86: Add tests for UC_SIGCONTEXT_SS and UC_STRICT_RESTORE_SS Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox