From patchwork Thu Nov 6 14:36:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 40316 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 11F3024237 for ; Thu, 6 Nov 2014 14:38:24 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id e51sf2232390eek.2 for ; Thu, 06 Nov 2014 06:38:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=aJiZgPeMRGliGEoQDe3IBDKtvnsOWvsZdhBSQW0tXOw=; b=T/mN7fVhgauyrv3LTEDOSBcSC6MB8DMVw7p89KahDknMbZ7Aw2lMkqb5mSOfLKT0NN LLeYq/U3FhoFEb1i5oO0YEztF//aYnjQmc3xs8EBJ7czHGWp/i0pwOU2npsQjO6TZhHY 7s4o/mnCJYXxixIleyASaJ43uQVW6R0DO03xY25kcNiKR6Ttr8gMjbmVhzSm2JsAZq4g jNgf2R7YW8WV8peU9PXc8Wp4lNuuwbxVhUMhltMzWk/jgnY4yq9YQppZYL/tz+CDoU+k Vz8BoTw1Hl5QU5fUkkB+J1B52ScWrsXcp5Bq5+rRGa7wafh1mOBghpkmCqayt3KaDW9Z gB2Q== X-Gm-Message-State: ALoCoQlubWO3GoCOSzzU5kIHh5ZGgPWLxS/PamHDvdonoMObSMHp91kd13S1sggxO0zk+jCCh4S4 X-Received: by 10.112.55.10 with SMTP id n10mr380402lbp.14.1415284703272; Thu, 06 Nov 2014 06:38:23 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.68 with SMTP id da4ls75682lad.87.gmail; Thu, 06 Nov 2014 06:38:22 -0800 (PST) X-Received: by 10.152.43.97 with SMTP id v1mr5392386lal.3.1415284702975; Thu, 06 Nov 2014 06:38:22 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id az8si8067602lbc.132.2014.11.06.06.38.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 06:38:22 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z12so996738lbi.36 for ; Thu, 06 Nov 2014 06:38:22 -0800 (PST) X-Received: by 10.152.120.199 with SMTP id le7mr5239420lab.67.1415284702802; Thu, 06 Nov 2014 06:38:22 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp53526lbc; Thu, 6 Nov 2014 06:38:22 -0800 (PST) X-Received: by 10.180.12.136 with SMTP id y8mr42032493wib.73.1415284702076; Thu, 06 Nov 2014 06:38:22 -0800 (PST) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com. [209.85.212.171]) by mx.google.com with ESMTPS id vx1si9735627wjc.72.2014.11.06.06.38.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 06:38:22 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.171 as permitted sender) client-ip=209.85.212.171; Received: by mail-wi0-f171.google.com with SMTP id r20so1666595wiv.16 for ; Thu, 06 Nov 2014 06:38:21 -0800 (PST) X-Received: by 10.180.187.130 with SMTP id fs2mr41054338wic.24.1415284698264; Thu, 06 Nov 2014 06:38:18 -0800 (PST) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id pc8sm8029386wjb.36.2014.11.06.06.38.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 06:38:17 -0800 (PST) From: Daniel Thompson To: Jason Wessel Cc: Daniel Thompson , kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, Andrew Morton , Greg Kroah-Hartman , Jiri Slaby , Steven Rostedt , Frederic Weisbecker , Ingo Molnar , Colin Cross , kernel-team@android.com, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Sumit Semwal , Anton Vorontsov Subject: [RESEND PATCH v5 3.18-rc3 8/8] kdb: Allow access to sensitive commands to be restricted by default Date: Thu, 6 Nov 2014 14:36:47 +0000 Message-Id: <1415284607-7628-9-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1415284607-7628-1-git-send-email-daniel.thompson@linaro.org> References: <1415284607-7628-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently kiosk mode must be explicitly requested by the bootloader or userspace. It is convenient to be able to change the default value in a similar manner to CONFIG_MAGIC_SYSRQ_DEFAULT_MASK. Signed-off-by: Daniel Thompson Cc: Jason Wessel --- kernel/debug/kdb/kdb_main.c | 2 +- lib/Kconfig.kgdb | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index fe1ac56..8d84979 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -47,7 +47,7 @@ #undef MODULE_PARAM_PREFIX #define MODULE_PARAM_PREFIX "kdb." -static int kdb_cmd_enabled; +static int kdb_cmd_enabled = CONFIG_KDB_DEFAULT_ENABLE; module_param_named(cmd_enable, kdb_cmd_enabled, int, 0600); #define GREP_LEN 256 diff --git a/lib/Kconfig.kgdb b/lib/Kconfig.kgdb index 358eb81..c635a10 100644 --- a/lib/Kconfig.kgdb +++ b/lib/Kconfig.kgdb @@ -73,6 +73,31 @@ config KGDB_KDB help KDB frontend for kernel +config KDB_DEFAULT_ENABLE + hex "KDB: Select kdb command functions to be enabled by default" + depends on KGDB_KDB + default 0x1 + help + Specifiers which kdb commands are enabled by default. This may + be set to 1 or 0 to enable all commands or disable almost all + commands. + + Alternatively the following bitmask applies: + + 0x0002 - allow arbitrary reads from memory and symbol lookup + 0x0004 - allow arbitrary writes to memory + 0x0008 - allow current register state to be inspected + 0x0010 - allow current register state to be modified + 0x0020 - allow passive inspection (backtrace, process list, lsmod) + 0x0040 - allow flow control management (breakpoint, single step) + 0x0080 - enable signalling of processes + 0x0100 - allow machine to be rebooted + + The config option merely sets the default at boot time. Both + issuing 'echo X > /sys/module/kdb/parameters/cmd_enable' or + setting with kdb.cmd_enable=X kernel command line option will + override the default settings. + config KDB_KEYBOARD bool "KGDB_KDB: keyboard as input device" depends on VT && KGDB_KDB