linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] ptrace-vs-syscall-restart fixes, v3
@ 2016-06-20 23:39 Andy Lutomirski
  2016-06-20 23:39 ` [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code Andy Lutomirski
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Andy Lutomirski @ 2016-06-20 23:39 UTC (permalink / raw)
  To: x86, linux-kernel; +Cc: Borislav Petkov, Andy Lutomirski

Now that I have a complete fix and cleanup that I like, here it is.
Patch 1 is the same as before except for a config-dependent build
fix.

This series is a cleanup and fixes at least two bugs:

 - 64-bit gdb attached to a 32-bit program malfunctions if the user
   types something like "print foo()" while stopped on exit from an
   interrupted ERESTART_RESTARTBLOCK-using syscall.

 - A 32-bit tracer that writes orig_eax while the tracee is stopped
   at syscall entry will break in_ia32_syscall() and
   syscall_get_arch().

After this is applied, it might be safe to drop all of the TS_COMPAT
checks in syscall.h, but I'd want to think carefully about that.

The reason that patch 1 is here at all instead of being folded into
the other patches is that it's intended to be cleanly and safely
backported if needed.

Patch 1 is for 4.7 or 4.8 at the maintainers' discretion.  It could
also make sense for -stable -- I thing it fixes a bug that could be
exploited to confuse the syscall auit logs.  Patch 2 and 3 are
intended for 4.8.

Pedro, can you try to test this series a bit?  I'm having trouble
getting ptrace-tests to pass even on an unmodified kernel.

Andy Lutomirski (3):
  x86/ptrace: Stop setting TS_COMPAT in ptrace code
  x86/signal: Rewire the restart_block() syscall to have a constant nr
  x86/ptrace, x86/signal: Remove TS_I386_REGS_POKED

 arch/x86/entry/syscalls/syscall_32.tbl |  2 ++
 arch/x86/entry/syscalls/syscall_64.tbl |  3 +++
 arch/x86/include/asm/syscall.h         |  3 ---
 arch/x86/kernel/ptrace.c               | 34 +++++++++++++++++++++-------------
 arch/x86/kernel/signal.c               | 16 ++++++++++------
 5 files changed, 36 insertions(+), 22 deletions(-)

-- 
2.5.5

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

end of thread, other threads:[~2016-07-26  0:21 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20 23:39 [PATCH v3 0/3] ptrace-vs-syscall-restart fixes, v3 Andy Lutomirski
2016-06-20 23:39 ` [PATCH v3 1/3] x86/ptrace: Stop setting TS_COMPAT in ptrace code Andy Lutomirski
2016-06-22 22:13   ` Oleg Nesterov
2016-07-24 18:47   ` Andy Lutomirski
2016-07-25  6:38     ` Ingo Molnar
2016-07-25 16:38       ` Oleg Nesterov
2016-07-25 16:57       ` Andy Lutomirski
2016-07-26  0:21         ` Andy Lutomirski
2016-06-20 23:39 ` [PATCH v3 2/3] x86/signal: Rewire the restart_block() syscall to have a constant nr Andy Lutomirski
2016-06-21 12:39   ` Pedro Alves
2016-06-21 16:32     ` Andy Lutomirski
2016-06-22 12:00       ` Pedro Alves
2016-06-22 15:20         ` Andy Lutomirski
2016-06-23 21:21   ` Oleg Nesterov
2016-06-20 23:39 ` [PATCH v3 3/3] x86/ptrace, x86/signal: Remove TS_I386_REGS_POKED Andy Lutomirski
2016-06-23 21:26   ` Oleg Nesterov
2016-06-23 21:53     ` 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).