kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH 0/3] x86/signal/64: A better attempt at SS cleanup
@ 2015-08-13 20:18 Andy Lutomirski
  2015-08-13 20:18 ` [RFC/PATCH 1/3] x86/kvm: Rename VMX's segment access rights defines Andy Lutomirski
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Andy Lutomirski @ 2015-08-13 20:18 UTC (permalink / raw)
  To: Linus Torvalds, Stas Sergeev, x86
  Cc: Cyrill Gorcunov, Pavel Emelyanov, kvm list, Andy Lutomirski

This is almost certainly not 4.2 material.

This applies to -linux before the sigcontext revert.  If people like
these, I'll rebase them on top of the revert and I'll do something about
the UAPI build issue (if necessary -- renaming __pad0 may actually be
fine).

This should allow new programs to opt in to sane SS handling.  It makes
signal delivery reliable in the face of weird SS values (it was
unreliable before Linux 4.1, and it's unreliable again after the
revert).  Unlike the previous try, it should *not* break DOSEMU's hack
to figure out what SS was at the time of signal delivery, at least in
cases where DOSEMU wouldn't crash outright due to completely bogus SS
values.  Also unlike the previous try, it won't crash DOSEMU when DOSEMU
invalidates the old SS from a signal handler but doesn't know to update
the sigcontext.

The sigreturn_64 selftest is updated to use the new flag.  It passes.
For a real version of these patches, I'll add more tests to make sure
that we get the weird corner cases right.  (There are probably cases
where this isn't quite right on Xen, too, but we might not care.)

Andy Lutomirski (3):
  x86/kvm: Rename VMX's segment access rights defines
  x86/signal/64: Try to preserve hardware SS across 64-bit signal
    delivery
  x86/signal/64: Add explicit controls for sigcontext SS handling

 arch/x86/include/asm/desc_defs.h        | 23 +++++++++++
 arch/x86/include/asm/sighandling.h      |  1 -
 arch/x86/include/asm/vmx.h              | 46 +++++++++++-----------
 arch/x86/include/uapi/asm/ucontext.h    | 26 +++++++++---
 arch/x86/kernel/signal.c                | 70 ++++++++++++++++++++++++++++-----
 arch/x86/kvm/vmx.c                      | 14 +++----
 tools/testing/selftests/x86/sigreturn.c | 26 ++++++++++++
 7 files changed, 160 insertions(+), 46 deletions(-)

-- 
2.4.3


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

end of thread, other threads:[~2015-08-14 22:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13 20:18 [RFC/PATCH 0/3] x86/signal/64: A better attempt at SS cleanup Andy Lutomirski
2015-08-13 20:18 ` [RFC/PATCH 1/3] x86/kvm: Rename VMX's segment access rights defines Andy Lutomirski
2015-08-14 22:47   ` Paolo Bonzini
2015-08-13 20:18 ` [RFC/PATCH 2/3] x86/signal/64: Try to preserve hardware SS across 64-bit signal delivery Andy Lutomirski
2015-08-13 20:25   ` Andy Lutomirski
2015-08-13 21:26     ` Andy Lutomirski
2015-08-13 21:41       ` Linus Torvalds
2015-08-13 21:49         ` Andy Lutomirski
2015-08-13 22:03           ` Andy Lutomirski
2015-08-13 20:18 ` [RFC/PATCH 3/3] x86/signal/64: Add explicit controls for sigcontext SS handling Andy Lutomirski
2015-08-14 20:55   ` Cyrill Gorcunov
2015-08-14 20:57     ` Andy Lutomirski
2015-08-14 21:05       ` Cyrill Gorcunov

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).