From patchwork Wed Jan 7 16:34:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 42847 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7D1952055F for ; Wed, 7 Jan 2015 16:45:18 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf968981wiv.5 for ; Wed, 07 Jan 2015 08:45:17 -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=zJ+dUFPzYKeL49ZfOzaEoCeHbmxFcrYTENZZXXzRPOo=; b=K+mFhYUAUobyGYPJNuikb0kxnueFTsJBxCfmXpqF1yCIrziXR4P6l3gRuJftTldObA KOShShGpEcZ2HSTW4us3SXGIK+74I+KkJE7N3+sGZlZwKLIKt72CG9mGHD+qu/YG31Vn pCSRlsi31TOwhEHaQf52iBz99GFxuy4r8/oPoJgIkZyqEMAITFKSYuzPZrorH4EVklmE 3WXofqpaBnt6vIKxmHL+9Oeo+7B+uSxSvFkDvPMrG+u/TmQDRpvMw40MSWlM+jM/hQVp UD9xTde5fxU/Cq4XoTtMSigP9lrK7qIvNWPh7X6rF8ngfryD1WoxVnfzU8F6ohTqNQkP LDQA== X-Gm-Message-State: ALoCoQmucVKVYe14GoMF1BObmgro2tCGl3booUZ+lI2kmv8fu4nYYpQH8R7Lqrnfvks1NOWsydRm X-Received: by 10.180.105.97 with SMTP id gl1mr3096878wib.7.1420649117403; Wed, 07 Jan 2015 08:45:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.73 with SMTP id o9ls179696laj.65.gmail; Wed, 07 Jan 2015 08:45:17 -0800 (PST) X-Received: by 10.152.43.49 with SMTP id t17mr6338428lal.52.1420649117252; Wed, 07 Jan 2015 08:45:17 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id w4si3801478law.77.2015.01.07.08.45.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 08:45:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gm9so4625414lab.12 for ; Wed, 07 Jan 2015 08:45:17 -0800 (PST) X-Received: by 10.112.104.4 with SMTP id ga4mr6240234lbb.24.1420649117168; Wed, 07 Jan 2015 08:45:17 -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.9.200 with SMTP id c8csp1539928lbb; Wed, 7 Jan 2015 08:45:15 -0800 (PST) X-Received: by 10.180.73.206 with SMTP id n14mr9237643wiv.60.1420649107979; Wed, 07 Jan 2015 08:45:07 -0800 (PST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com. [209.85.212.172]) by mx.google.com with ESMTPS id er3si6384802wib.56.2015.01.07.08.45.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 08:45:07 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.172 as permitted sender) client-ip=209.85.212.172; Received: by mail-wi0-f172.google.com with SMTP id n3so7891388wiv.5 for ; Wed, 07 Jan 2015 08:45:07 -0800 (PST) X-Received: by 10.180.93.167 with SMTP id cv7mr9454062wib.12.1420649107529; Wed, 07 Jan 2015 08:45:07 -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 cp4sm2741640wjb.16.2015.01.07.08.45.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jan 2015 08:45:06 -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.19-rc2 8/8] kdb: Allow access to sensitive commands to be restricted by default Date: Wed, 7 Jan 2015 16:34:58 +0000 Message-Id: <1420648498-17428-9-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1420648498-17428-1-git-send-email-daniel.thompson@linaro.org> References: <1399381429-16194-1-git-send-email-daniel.thompson@linaro.org> <1420648498-17428-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.215.53 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 fe1ac56b62e9..8d84979cbe05 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 358eb81fa28d..c635a107a7de 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