Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2179147ybg; Fri, 5 Jun 2020 07:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbpYDa1qAgo0afV+9pW2m0UwS6nXTqT1Cco73q3RJ80PcSesVEtrAlMUyjERcOVju1QHLt X-Received: by 2002:aa7:d28d:: with SMTP id w13mr9677356edq.336.1591367530201; Fri, 05 Jun 2020 07:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591367530; cv=none; d=google.com; s=arc-20160816; b=EOMfB5DLMjcJDKULG8xA2TIdQWvIYOgPoct4whyLZ1UU9fJZoSQOyeJvxPrTnGEI5x fvK+rvhCT3yG4SNnD9RFjGOeAiF0wnW3LyCDdeFRuoQsdm6pL4UDkQxuyMHlD+HKj4T9 uhEpTRF8EQGC4ZtW3sbAoad0woFdlqm1ElhF4fuItdch8TAnsnRor+aecC45RU5fmwmW ZyQcl4fSCbguFjGm5IeK7PIDDzh9UX0X625D16yBW3FuWtkSfhgPDlBY/yBQnasvDiEo ax9DStDvA18/FyDFeAchkA7BfPgI+NcgS93aPD3eaWAYkf/K/02tGtvr/kEy4h6BFng3 yx8g== 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=dQozpauM+B1HUAZG/afzEGekuT2pBrCyXAH6b1RYzE4=; b=lHD+pd3d/bOV4FzTl/Q7/73LWhaxGJzVx0brKLM6SQ/p4cstl7ORZX/fclaEkj3LoI 4QIHqLud/Wgwxm2cqA1itsadChzejKY+URm12WPanI9DqJUrK3/eOmzbVV0S143xppHi JyLhsN1Av2fNjtEt/QJQRTqto0wpCC3cDYnGqeCtBSqQcDBcVLfep7e5yNa7ScplvKNw MDhAEsrr3/AqC/WQDBPsI9iAP6E8YIHG6U22M7wMqcc19g3AY7acTM1fZ5GD1OQ9JBrt EryZIFjssRVUSgLO6nHFvMyFQsWxISUoEa7CXl4Il9L0ItRPQE4f6F0McmW0eJBBdtHn aGVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="blC/DwwD"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x25si3780227ejs.242.2020.06.05.07.31.46; Fri, 05 Jun 2020 07:32:10 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="blC/DwwD"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728085AbgFEOaF (ORCPT + 99 others); Fri, 5 Jun 2020 10:30:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727945AbgFEOaE (ORCPT ); Fri, 5 Jun 2020 10:30:04 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C65F0C08C5C2 for ; Fri, 5 Jun 2020 07:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dQozpauM+B1HUAZG/afzEGekuT2pBrCyXAH6b1RYzE4=; b=blC/DwwD+vyB/QngYMRyJPdJ8C V/5m7Ky94t+nyRbIDIUeFa8RemAN6Mv0NKXuzcOm12jCNeumPX6PkLdSHeSP/NPKSPbnFV9EX1baf I72TSiScqkQ9b9vjFRdJpJT6f5YNVARLIhUOBFxffwVktD3uuTWKh5RuI1Q38xM4adem6gu3oR5h7 RhlAwEXeObcvsurFcBwrW//vfTvnYtor7Ynf0pPc+WpHe7WXyZ5RCIQMIN+HnMVPDIfHEoUCRvMNA qikHKMuyXY6kzMnKyvtPZpClw+6YTt2EkljoptEuZtzZ0FyxFx2aUJSHprjZMfl+pus1CxJ7FR7En 9CQA/zgA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jhDM2-0001lD-Vx; Fri, 05 Jun 2020 14:29:55 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2E14E304BDF; Fri, 5 Jun 2020 16:29:53 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0FD4621A74B3C; Fri, 5 Jun 2020 16:29:53 +0200 (CEST) Date: Fri, 5 Jun 2020 16:29:53 +0200 From: Peter Zijlstra To: Daniel Thompson 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: <20200605142953.GP2750@hirez.programming.kicks-ass.net> References: <20200605132130.1411255-1-daniel.thompson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200605132130.1411255-1-daniel.thompson@linaro.org> 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 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.