Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4349556ybg; Mon, 8 Jun 2020 05:48:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx78EJLts3T/hyV0f3wK0XXjh4Z5hnZqO2kSz07Ooeyze9PT8uRasvEA1kov02X01SzQrEN X-Received: by 2002:a17:906:f115:: with SMTP id gv21mr20101725ejb.340.1591620531104; Mon, 08 Jun 2020 05:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591620531; cv=none; d=google.com; s=arc-20160816; b=y8o7I7buiB2XqNFygtAx1vWQLyo0+oiNOA5ErT7GM7+g/9aIi7/SjlyVRoDZnOLU8Y bawyrGPe4iRzPEMVV9sVWuN6hrTzIDT314Y3vhyhW8mFCDWXBeKdNZn/l4zd1wbIQ5S1 /QOeMcXachC5K2hAS9jPffkr6MB04/xeO9ZkPwY3Zut4ZFie2tXg18iZ3XD3uxgwRzSK IORRB8NXt6UclMth/1mq8elF6xrlSXfVBvcluevhbYSt1LATS6zTKeNjexPa+yfUXqcI E+/3UCZMzSHSshrYkTGn3MvBLzJKp0Qfbxi971MHJ7vtgeZKrVpO5Et+ODG0s3Ohsy4q 2VCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=OnT205P+Q9ExcEEivUSebKDFNf0i4UfVrNiNXILSir4=; b=evdnbNWvVBlcMwCTSxRav9UZQaW3tyCRqQP8cCsRvhr6D0PZ2EZcSSV5VWBagVbkQx ZJesExYFGLm/I1uZYCNKpwiaIliV8nl+pktG0mvV0oGN4nOmPCYQAQiC0Vlu1M6y6Wz5 0tXq1aEdQRB5TZBomBGLFvSF0kyYzD5iUhwEd7zLco5fentjGIS2+JrHmsReV97/zei+ EXFAuuPtwFuDFPX40zCJzh7RA6aSnMMU0mE8ygzY1PgI5h+vohJuXqpzht//QD+FJLwh KppFJpUxhlIxXUL5v1o3WilQaUVifZulHnuV5z0FL3Rh4ECRr5bMFQ+lKuRZQL1KLJnf Pv3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S1ULEvkP; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si9276015edm.343.2020.06.08.05.48.25; Mon, 08 Jun 2020 05:48:51 -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=@linaro.org header.s=google header.b=S1ULEvkP; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729111AbgFHMni (ORCPT + 99 others); Mon, 8 Jun 2020 08:43:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727052AbgFHMnh (ORCPT ); Mon, 8 Jun 2020 08:43:37 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E498EC08C5C2 for ; Mon, 8 Jun 2020 05:43:36 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id c71so15177506wmd.5 for ; Mon, 08 Jun 2020 05:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OnT205P+Q9ExcEEivUSebKDFNf0i4UfVrNiNXILSir4=; b=S1ULEvkPVLdl7+HUPl+/XXL5M1NFP/GaiAuNCbCi57rh3L6BKfVw6ceUIPW2qrC4UZ 3duKjga+IN3TmxRo8schydvUJ3X3maD5P8eU2C9vbYcYlGhARdUAHSwXB37O046n7Ucw taGXyrZoNAwtnc/zKdtbW+83nurquibXu8b8TCjEaira/VpoOuakEA7Kn6QoPmmhiBIk 73bqZaYgJbRIyva9gUbJG8IhhrNjiWdOgJkuJhEKelzcnGPwLa3XY9vYDtqd50diaNH/ 7E4wQmACp5f5AcRWKf9JTvuwzh+NNDp0QKe8XIe1gNveRK3+VJVX/NXRzzZHhH/h1nUe nbmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OnT205P+Q9ExcEEivUSebKDFNf0i4UfVrNiNXILSir4=; b=H0DNmI4POpMRPYEBurtVZ97Q2SLe87H0+3YUSZMUWE2RCXA8UQ1CZFrADSnT07e/w6 xRncQ208BcFDdV9f7gpzd9vQh+ntRLEI+0ZNS+kzgOHRUQ9zbqYA2u6yNye8oevqR49q uJ+UvdIQojXNYmS2zWyn5XdvGxd8bol1zmBJGTRTNEFxqVMr4fzErPLNsNrecVmMs8Id xT5yWDtCjwwKA6LatqWOatMVIe6pzJISZS8qPjPQlLK101lbsP5iiCkYy/7np3gGvwhL m1FPfdlvP85E6qDC77J+WZpWApdTRhRHRvC+FN2titiizWq66bUACXJyo1NVxpJNQat6 7Lmg== X-Gm-Message-State: AOAM532TESvZQHmW3ZGwiohsOaAHRR4/bRm94wrfjQjuXme3zj5/sToP nsKyKJpRNeLimSX5fUYCn9LbDw== X-Received: by 2002:a1c:6006:: with SMTP id u6mr15373622wmb.39.1591620215530; Mon, 08 Jun 2020 05:43:35 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id l17sm23442506wrq.17.2020.06.08.05.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 05:43:34 -0700 (PDT) Date: Mon, 8 Jun 2020 13:43:32 +0100 From: Daniel Thompson To: Peter Zijlstra Cc: Jason Wessel , Douglas Anderson , sumit.garg@linaro.org, pmladek@suse.com, sergey.senozhatsky@gmail.com, will@kernel.org, kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, patches@linaro.org, Masami Hiramatsu Subject: Re: [RFC PATCH 0/4] kgdb: Honour the kprobe blacklist when setting breakpoints Message-ID: <20200608124332.mzamwmdowu6dlh6k@holly.lan> References: <20200605132130.1411255-1-daniel.thompson@linaro.org> <20200605142953.GP2750@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200605142953.GP2750@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 05, 2020 at 04:29:53PM +0200, Peter Zijlstra wrote: > On Fri, Jun 05, 2020 at 02:21:26PM +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 does intrinsically > > provide 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 ;-) ) but the current no safety rail approach is not easy to > > defend, especially given kprobes provides us with plenty of machinery to > > mark parts of the kernel where breakpointing is discouraged. > > > > This patchset introduces some safety rails by using the existing > > kprobes infrastructure. It does not cover all locations where > > breakpoints can cause trouble but it will definitely block off several > > avenues, including the architecture specific parts that are handled by > > arch_within_kprobe_blacklist(). > > > > This patch is an RFC because: > > > > 1. My workstation is still chugging through the compile testing. > > > > 2. Patch 4 needs more runtime testing. > > > > 3. The code to extract the kprobe blacklist code (patch 4 again) needs > > more review especially for its impact on arch specific code. > > > > To be clear I do plan to do the detailed review of the kprobe blacklist > > stuff but would like to check the direction of travel first since the > > change is already surprisingly big and maybe there's a better way to > > organise things. > > Thanks for doing these patches, esp 1-3 look very good to me. > > I've taken the liberty to bounce the entire set to Masami-San, who is > the kprobes maintainer for comments as well. Not a liberty... leaving out Masami-san was an oversight on my part. Thanks for connecting! Daniel.