Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1992335ybh; Fri, 17 Jul 2020 06:51:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBQJrZPiwJcutSfuDJtOfBJ+VDWWiSQpAwLgn6/mCc83BW351Tdz4wh+TlFnkFpayhN/Pm X-Received: by 2002:a50:f392:: with SMTP id g18mr9161019edm.151.1594993891199; Fri, 17 Jul 2020 06:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594993891; cv=none; d=google.com; s=arc-20160816; b=zhBYA6nrQz8qyDouxiDTNMCFwttquD/vyry0/wL84hMb+YLUGC29BuX81tBPvwqWQV XhVEKygPipjEaenvzmVS3spxdpSOJBoxq2M21F2ldte0QgeQrQi4AkvKedfjJPX7tzQp 2wmpEJi78ct3VMqHm5EYhep+zXIJ8MoGSNJGb/fGVo8AZWKnQGN8pOtLmnlefoTX0+YE jVCr+em4y3W3/z3MJFmtQcVPKg/JgUtkbv6ebGu3IyQkmrioILGWSUrjZW354vVATH4r e2XBKx99A0pn3QOqWnSHpo7PhFAgEgWFLQpS27h9YdgvjVIemaLS7D4JRJAKzaDtaB+c 4cfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=nmgd3X8IKkqnqgWbk79VWuQr/9KqRpLi3HiDwSh54Sk=; b=B2jKtpMnZNQ3L5x8xYGHEXnKJEOn5612qiOOyzlEufaoUcTLFtng1bvjxm1wH9hy49 IdtwEDeWmd960z+UwQT22MI/8BKiWGCF/4DpNO+JZf8buANH2PPvrj9e8acDAgfqRh78 YDgUXVWsxkIWj93o3/8wB1tfjtBeHXJS+AyVzS+trZdJCfhiIpuMlYBZ/Glt3xz8gX2z HgT8vvdaz3vuC+0Tf99VGKGy2en6cnmc0V6OnW1GBA1tFeEBCWHOuEaUfR+80vTpwBh2 ltHAUNM7RP0sejivzZDjdJf+PTDsJ6d4yBUG5TtO9FZsxTaAhI/CVQYeZVvEPvvyfAzS cBAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CvOlz5oa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh22si5265492ejb.553.2020.07.17.06.51.07; Fri, 17 Jul 2020 06:51:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CvOlz5oa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbgGQNsc (ORCPT + 99 others); Fri, 17 Jul 2020 09:48:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:39536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbgGQNsc (ORCPT ); Fri, 17 Jul 2020 09:48:32 -0400 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 07E9E2076A; Fri, 17 Jul 2020 13:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594993712; bh=A/hm+ncUzrilRPL6Iq4RL68tleP0XF+QknAVyixwc1g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CvOlz5oabVzstaOLVZA61byXNbjnvEktZKypAf7I3zp3ssUX3umwgbYI67tlmWbpr 26D6NXncecHSsTC2cJ8rycyhNySsKMgBDS+r3DJr201xopxc69WB7rL2dsdtv9wOQP 4DdCDro/S8Hbq2zGvJ8lIAccd2ZW/vts0mBz4DzQ= Date: Fri, 17 Jul 2020 22:48:26 +0900 From: Masami Hiramatsu To: Daniel Thompson Cc: Jason Wessel , Douglas Anderson , Peter Zijlstra , sumit.garg@linaro.org, pmladek@suse.com, sergey.senozhatsky@gmail.com, will@kernel.org, Masami Hiramatsu , kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, patches@linaro.org Subject: Re: [PATCH v2 0/3] kgdb: Honour the kprobe blacklist when setting breakpoints Message-Id: <20200717224826.80f8353e5dfdfaab22421385@kernel.org> In-Reply-To: <20200716151943.2167652-1-daniel.thompson@linaro.org> References: <20200716151943.2167652-1-daniel.thompson@linaro.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, On Thu, 16 Jul 2020 16:19:40 +0100 Daniel Thompson wrote: > kgdb has traditionally adopted a no safety rails approach to breakpoint > placement. If the debugger is commanded to place a breakpoint at an > address then it will do so even if that breakpoint results in kgdb > becoming inoperable. > > A stop-the-world debugger with memory peek/poke intrinsically provides > its operator with the means to hose their system in all manner of > exciting ways (not least because stopping-the-world is already a DoS > attack ;-) ). Nevertheless the current no safety rail approach is > difficult to defend, especially given kprobes can provide us with plenty > of machinery to mark the parts of the kernel where breakpointing is > discouraged. > > This patchset introduces some safety rails by using the existing kprobes > infrastructure and ensures this will be enabled by default on > architectures that implement kprobes. At present it does not cover > absolutely all locations where breakpoints can cause trouble but it will > block off several avenues, including the architecture specific parts > that are handled by arch_within_kprobe_blacklist(). This series looks good to me. Acked-by: Masami Hiramatsu To fix the build error with ipw2x00 driver, please feel free to include my fix patch. Thank you, > > > Daniel Thompson (3): > kgdb: Honour the kprobe blocklist when setting breakpoints > kgdb: Use the kprobe blocklist to limit single stepping > kgdb: Add NOKPROBE labels on the trap handler functions > > include/linux/kgdb.h | 19 +++++++++++++++++++ > kernel/debug/debug_core.c | 25 +++++++++++++++++++++++++ > kernel/debug/gdbstub.c | 10 +++++++++- > kernel/debug/kdb/kdb_bp.c | 17 +++++++++++------ > kernel/debug/kdb/kdb_main.c | 10 ++++++++-- > lib/Kconfig.kgdb | 14 ++++++++++++++ > 6 files changed, 86 insertions(+), 9 deletions(-) > > -- > 2.25.4 > -- Masami Hiramatsu