From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754768AbcFUAFj (ORCPT ); Mon, 20 Jun 2016 20:05:39 -0400 Received: from mail.kernel.org ([198.145.29.136]:60636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753195AbcFUAFa (ORCPT ); Mon, 20 Jun 2016 20:05:30 -0400 From: Andy Lutomirski To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Borislav Petkov , Andy Lutomirski Subject: [PATCH v3 0/3] ptrace-vs-syscall-restart fixes, v3 Date: Mon, 20 Jun 2016 16:39:51 -0700 Message-Id: X-Mailer: git-send-email 2.5.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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