Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2327642ybh; Fri, 17 Jul 2020 15:40:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaEqRAD/w9knBkgDiZmH2oTXpylXGqCduueNA/1/A1+MxHO+SnFW0XixTRr1jV1H++5Pa4 X-Received: by 2002:a05:6402:319b:: with SMTP id di27mr11630987edb.133.1595025634542; Fri, 17 Jul 2020 15:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595025634; cv=none; d=google.com; s=arc-20160816; b=crzRBsPFroOeNINhFof21KEWMBai6qQ9x+sTuQIAlSNbkrvm7BukM4voJWr+uUa08M 0VHrjg5e8nMt9GFbpDyV/RE8SWWMms2aKv9T381pWgNk4ITR6lTWl7fNHB0i2K2DugYB GRYAGDX99Y+HbcWcmx06VurwSNSSDflV5GYkzoi5Y/JRAwVczRb7f6zlGDuNBkosahwR QGXlfGgI09CfxAI6tpT34cUl6wYwWQxf/qlWJUFdgbHyfLi+Im05cSbXOtLo6nAzaNF1 f4/Pl+9DkSXpYI9Fc0q0DGwGZgq193aCq+W3Q7eFD7xGCDdjEhrx9C4rn14GEDcnNi/6 l7UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KTzkNMrSwyq0Nv+U+VjnxqvQEMur6myVfbA5cZN1NmQ=; b=J26r1/xk3fwSAExSsBGAUn5euxZXuapsKVzAllAA8Hruv3nKKLTkbLM50n0gMTPcB4 AGnvmB9e1rXpPzXAxGAN3EhnoeIkA7oh0hmN3SWLl6+eX6D4z4W+FMVVsMzcxbov/iAw ZrDnnyKafZ6Rh2kMsKMdfZvte7VovT+PmaOLKqdc+ycBjdwhNtBmEqB2GDYw/i4J4K18 y+MuHcfuOUOFw5jmHCYL0EcajQL52lUkg8cUxt644JAjW8bRgryoHVpy6oZisRF3iRf1 JG0W+o2GJMVyhpDYhms7ik1JRLuz3BZEOmiLVQMWZQyu+U2LgDwEH62yexmYxS/4doO6 tivA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=anj7sbR3; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si6114021edx.581.2020.07.17.15.40.12; Fri, 17 Jul 2020 15:40:34 -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=@chromium.org header.s=google header.b=anj7sbR3; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbgGQWjw (ORCPT + 99 others); Fri, 17 Jul 2020 18:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbgGQWjw (ORCPT ); Fri, 17 Jul 2020 18:39:52 -0400 Received: from mail-vk1-xa41.google.com (mail-vk1-xa41.google.com [IPv6:2607:f8b0:4864:20::a41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58680C0619D2 for ; Fri, 17 Jul 2020 15:39:52 -0700 (PDT) Received: by mail-vk1-xa41.google.com with SMTP id r7so2459931vkf.0 for ; Fri, 17 Jul 2020 15:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KTzkNMrSwyq0Nv+U+VjnxqvQEMur6myVfbA5cZN1NmQ=; b=anj7sbR3gHHz3pzQ2Ipg9Wh7rvglfTdQbjTjABe/EZlztDtVTkGTG4xUBw1qYq73W8 gd2WYYGYPYOCVbDYxcee5lvkREjjWLCBiuqRm2yaTdP46zSKO3v32BIGFG5W3D1M+KTp wVfS9XfA29IIp0e56zQZBjftCyHvc5zJzodzU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KTzkNMrSwyq0Nv+U+VjnxqvQEMur6myVfbA5cZN1NmQ=; b=iJJZdDMFDAJ6buDfKVEWiF48a8/YswcHXMlWZGt2Ka+8Piy1oeImK+TUvtXvP6Aj74 h7Mo4qeiRfrEdQRsXHyTU3VBeqmw0VG5yQcnhhol5F6tNZSUmoveQ4k6KKWxKR8bw2uP kfUzo/Qwc4ROr/OFVmYLjUEAm/G343X6xLs9Dw5hB+WwK9TFWHwwWURbGo5liCIx4c60 G4wKtGO82AkuvOY7FqSbOVA9DhvJJOlvBjcZ8TRX7NV8Fv1ajBBvQjxv8Ns8H8HZk1bI pEzW9qvfStHIsicD103jzfbYI6PnvnXbGH0XZh4m84xx5p7taOKJvRUsVh1IJQD0ja33 0ybg== X-Gm-Message-State: AOAM532D5tipuzXdspECmWV4DEpJUTi0boEx07C6p8rK8kcm85CCYl/r UjvVCu7cXsbUHBlPOsOqtp0Ff5ReheA= X-Received: by 2002:a1f:418f:: with SMTP id o137mr8883231vka.25.1595025590353; Fri, 17 Jul 2020 15:39:50 -0700 (PDT) Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com. [209.85.217.45]) by smtp.gmail.com with ESMTPSA id f15sm1200188vsa.28.2020.07.17.15.39.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jul 2020 15:39:49 -0700 (PDT) Received: by mail-vs1-f45.google.com with SMTP id m6so5632715vsl.12 for ; Fri, 17 Jul 2020 15:39:48 -0700 (PDT) X-Received: by 2002:a67:ec0f:: with SMTP id d15mr8409511vso.121.1595025588164; Fri, 17 Jul 2020 15:39:48 -0700 (PDT) MIME-Version: 1.0 References: <20200716151943.2167652-1-daniel.thompson@linaro.org> <20200716151943.2167652-2-daniel.thompson@linaro.org> In-Reply-To: <20200716151943.2167652-2-daniel.thompson@linaro.org> From: Doug Anderson Date: Fri, 17 Jul 2020 15:39:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/3] kgdb: Honour the kprobe blocklist when setting breakpoints To: Daniel Thompson Cc: Jason Wessel , Peter Zijlstra , Sumit Garg , Petr Mladek , Sergey Senozhatsky , Will Deacon , Masami Hiramatsu , kgdb-bugreport@lists.sourceforge.net, LKML , Patch Tracking Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jul 16, 2020 at 8:20 AM Daniel Thompson wrote: > > Currently kgdb has absolutely no safety rails in place to discourage or > prevent a user from placing a breakpoint in dangerous places such as > the debugger's own trap entry/exit and other places where it is not safe > to take synchronous traps. > > Introduce a new config symbol KGDB_HONOUR_BLOCKLIST and modify the > default implementation of kgdb_validate_break_address() so that we use > the kprobe blocklist to prohibit instrumentation of critical functions > if the config symbol is set. The config symbol dependencies are set to > ensure that the blocklist will be enabled by default if we enable KGDB > and are compiling for an architecture where we HAVE_KPROBES. > > Suggested-by: Peter Zijlstra > Signed-off-by: Daniel Thompson > --- > include/linux/kgdb.h | 18 ++++++++++++++++++ > kernel/debug/debug_core.c | 4 ++++ > kernel/debug/kdb/kdb_bp.c | 9 +++++++++ > lib/Kconfig.kgdb | 14 ++++++++++++++ > 4 files changed, 45 insertions(+) Seems reasonable to me. Reviewed-by: Douglas Anderson