From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D03CC10F03 for ; Fri, 1 Mar 2019 13:28:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 F03AC20851 for ; Fri, 1 Mar 2019 13:28:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h0kBk3Zw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F03AC20851 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=I0vTSgmrmIWp9Pr9Vd3QESZ60M8DRUx9h6wGm6ZZ6eM=; b=h0k Bk3ZwQI3y8vF9WbMVm8h4j0vubw7k7YSNUA/nfpJRVqshzHn6KnkpIcvOCeT0Z2mfn76ciegghQ0Q nQnXzUtnYKxZv3AjOzJm+E8telW7PBYeTzXvQ21HIAAAUlpBYVX3a7HkDniPtYTAVeWbDPyOfM8MZ OgYVSdzdCZTbsbPAwqyCqfFFbdLUZOYpxEy5pFYU6DseIjuj0LdSl8qDfwiMhCwU0XIIvw8PeJf2E SmGvlS9nRyFrRG4oQcJHPIDJqrcZNZa0RAXq0CsB0p6H5QkUwhPGFYgQthMu7qj3TVMDtU60Tx3fy EBnEoIWNaBY/UTIcB90XZz+t+dT/iIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gziDE-0005YR-Eo; Fri, 01 Mar 2019 13:28:28 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gziD3-0005Nz-8e for linux-arm-kernel@lists.infradead.org; Fri, 01 Mar 2019 13:28:18 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0A4FCA78; Fri, 1 Mar 2019 05:28:15 -0800 (PST) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1A8CD3F5C1; Fri, 1 Mar 2019 05:28:13 -0800 (PST) From: Will Deacon To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 00/10] Rework debug exception handling code Date: Fri, 1 Mar 2019 13:27:59 +0000 Message-Id: <20190301132809.24653-1-will.deacon@arm.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_052817_308369_A6C35B4E X-CRM114-Status: UNSURE ( 9.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, catalin.marinas@arm.com, Will Deacon MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, Our debug exception handling code is a bit of a horror show. Userspace can trigger kprobe logic to run (which ends up just returning back to the brk instruction instead of delivering a SIGTRAP) and can also enter KGDB if it is enabled (which causes a kernel panic due to a NULL dereference). These patch fix those problems and tidy up the code so that they're less likely to happen again in future. Will --->8 Will Deacon (10): arm64: debug: Don't propagate UNKNOWN FAR into si_code for debug signals arm64: debug: Ensure debug handlers check triggering exception level arm64: debug: Remove unused return value from do_debug_exception() arm64: debug: Rename addr parameter for non-watchpoint exception hooks arm64: debug: Remove meaningless comment arm64: debug: Separate debug hooks based on target exception level arm64: kprobes: Avoid calling kprobes debug handlers explicitly arm64: debug: Remove redundant user_mode(regs) checks from debug handlers arm64: probes: Move magic BRK values into brk-imm.h arm64: debug: Clean up brk_handler() arch/arm64/include/asm/brk-imm.h | 4 ++ arch/arm64/include/asm/debug-monitors.h | 24 +++---- arch/arm64/include/asm/esr.h | 4 +- arch/arm64/include/asm/kprobes.h | 2 - arch/arm64/kernel/debug-monitors.c | 111 ++++++++++++++++++-------------- arch/arm64/kernel/kgdb.c | 28 ++++---- arch/arm64/kernel/probes/kprobes.c | 16 ++++- arch/arm64/kernel/probes/uprobes.c | 19 ++---- arch/arm64/kernel/traps.c | 21 ++---- arch/arm64/mm/fault.c | 19 ++---- 10 files changed, 127 insertions(+), 121 deletions(-) -- 2.11.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel