From patchwork Fri Jul 10 13:06:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 11656557 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DE2D618 for ; Fri, 10 Jul 2020 13:08:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA9E42078B for ; Fri, 10 Jul 2020 13:08:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DBy/koVJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="yP0OZddI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA9E42078B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=k0WuYKnbwlT2hhQQAN9yeP7pYMTDZgB8KqKHfSbEXfA=; b=DBy/koVJHO7D+3ONSxTLMOhIR/ lk/qAqGJ5RtSp2KJ0GJmO6TWV/jlC/hnCYQkEtQ7hp9F5ZdIz0h1gh+LeBwyQ23bSddlxsbwzFy1h MTmlVx+YAjcEYOz2iY1Wx6NeSfWP70gfFftI4ufxxhfQTW3mQVMV09i3wThpNMy91cQkCIuvkEOkN V96UlWIuzQJVlTTeIcnv3s5Mgnvp8ujmfYYmQBIibYWjQrVjUUL3tLyeRIX6xeVDicmoKCiZ/B5nm tcryGshqNVwWPq1er876f49cyI3O3FPgwMN4lU9USTcE60Ujz+hpvSziXxwlgKGmm4Aeq1yvQQ0S8 pKRo4IIA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtskC-0000un-Ll; Fri, 10 Jul 2020 13:07:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtsk9-0000tl-A8 for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2020 13:07:10 +0000 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 831CE20748; Fri, 10 Jul 2020 13:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594386427; bh=umJ4MAchwzbK3vV8aMiLdWgeMk3A+bsIDDumOCHU8bk=; h=From:To:Cc:Subject:Date:From; b=yP0OZddIIdcJSIhGlVvhVXC/QtlD4L76o7Gow1kfK+wwGkoMo94QH5tNcCwOZ1eFB 3UXZnacNUIX+Psxk92lWMH8em+O1Mr+zf6DRRwKI+DxWQi4n9S1qi7zdubiDOYpj8G VDJMv/seMyNMaqY6Af5RMKjSxfoUEmsm0cFffvUs= From: Will Deacon To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 0/7] arm64: Fix single-step handling and syscall tracing Date: Fri, 10 Jul 2020 14:06:55 +0100 Message-Id: <20200710130702.30658-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200710_090709_436047_BC798C1C X-CRM114-Status: GOOD ( 16.44 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Luis Machado , Kees Cook , Will Deacon , catalin.marinas@arm.com, Keno Fischer , kernel-team@android.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi folks, This is version three of the patches I previous posted here: v1: https://lore.kernel.org/r/20200603151033.11512-1-will@kernel.org v2: https://lore.kernel.org/r/20200702212618.17800-1-will@kernel.org This version includes some changes I've been hacking on in relation to syscall entry/exit, as it seemed worth lumping all this together. I've also reordered the series to put the fixes at the start. Luis -- did you manage to test v2? I'd quite like to queue some of this soon. If you don't have time, how can I run the GDB testsuite myself? I tried doing it a _long_ time ago but I remember there being a lot of failures and flakey tests, so it wasn't very helpful. I have arm64 hardware running Debian so it's just a question of which buttons to press :) Cheers, Will Cc: Cc: Mark Rutland Cc: Luis Machado Cc: Keno Fischer Cc: Kees Cook --->8 Will Deacon (7): arm64: ptrace: Consistently use pseudo-singlestep exceptions arm64: ptrace: Override SPSR.SS when single-stepping is enabled arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return arm64: ptrace: Add a comment describing our syscall entry/exit trap ABI arm64: syscall: Expand the comment about ptrace and syscall(-1) arm64: ptrace: Use NO_SYSCALL instead of -1 in syscall_trace_enter() arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP arch/arm64/include/asm/debug-monitors.h | 2 + arch/arm64/include/asm/syscall.h | 12 +++++- arch/arm64/include/asm/thread_info.h | 1 + arch/arm64/kernel/debug-monitors.c | 24 +++++++++--- arch/arm64/kernel/ptrace.c | 49 +++++++++++++++++++------ arch/arm64/kernel/signal.c | 11 +----- arch/arm64/kernel/syscall.c | 21 ++++++++++- 7 files changed, 90 insertions(+), 30 deletions(-)