From patchwork Fri Jul 11 11:33:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 33482 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 97B1820672 for ; Fri, 11 Jul 2014 11:36:25 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b6sf4122196yha.0 for ; Fri, 11 Jul 2014 04:36:25 -0700 (PDT) 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=8WZkgzUXMVatxqd4RIxcQjM0VFJrP5BHax1JzuIiI5k=; b=h/1XJaEThzLZPVM+KATo4eau9Y+aOTHDUzH6mlzLVMMa7DLOWZiVSbmN1dECssCV/2 ABezon9iD9XR/3sI/nMi5Q503CeXhZMbjeBwioULyP2lRcq8qhrp6FcKwRkMo45H738X 1x5ASuwQj6+Pr6ziCb4vRzN2/7oA11QvKzRpjvY0gcJqChDFts4a7yiRN8akesIKmh2I giuX2na6pvDmZ2pctXAf0kpAcbRpPNa4E6xlPytueoXpH8vNR5NWrTIo0HhnqVN1P4sL C+bWhKD+GK6L6CPLr35M9/Hy1eO9mJKD8Jotf1RRrWg/LQpznmBzVDIZAcwDrqedjD2T PjyA== X-Gm-Message-State: ALoCoQk4t3DPnBermuoK18dc+/oTZYm3vUztrkWeutGlOcdeDCuT470LEx7h3orn78KAZGjqOGu5 X-Received: by 10.236.101.148 with SMTP id b20mr22593025yhg.46.1405078585245; Fri, 11 Jul 2014 04:36:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.106 with SMTP id e97ls349311qgd.43.gmail; Fri, 11 Jul 2014 04:36:25 -0700 (PDT) X-Received: by 10.52.27.208 with SMTP id v16mr43321282vdg.21.1405078585164; Fri, 11 Jul 2014 04:36:25 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id xv9si1346517vdb.0.2014.07.11.04.36.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jul 2014 04:36:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ij19so1731218vcb.37 for ; Fri, 11 Jul 2014 04:36:25 -0700 (PDT) X-Received: by 10.52.27.208 with SMTP id v16mr43321276vdg.21.1405078585079; Fri, 11 Jul 2014 04:36:25 -0700 (PDT) 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.221.37.5 with SMTP id tc5csp27744vcb; Fri, 11 Jul 2014 04:36:24 -0700 (PDT) X-Received: by 10.180.105.68 with SMTP id gk4mr4351281wib.24.1405078583692; Fri, 11 Jul 2014 04:36:23 -0700 (PDT) Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by mx.google.com with ESMTPS id mu3si3428256wic.38.2014.07.11.04.36.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jul 2014 04:36:06 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.180 as permitted sender) client-ip=74.125.82.180; Received: by mail-we0-f180.google.com with SMTP id k48so10354wev.11 for ; Fri, 11 Jul 2014 04:36:05 -0700 (PDT) X-Received: by 10.194.90.77 with SMTP id bu13mr65706019wjb.92.1405078565102; Fri, 11 Jul 2014 04:36:05 -0700 (PDT) Received: from harvey.bri.st.com (LPuteaux-656-01-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id ub8sm6541984wib.0.2014.07.11.04.36.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jul 2014 04:36:04 -0700 (PDT) From: Daniel Thompson To: Jason Wessel Cc: Daniel Thompson , patches@linaro.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Steven Rostedt , Frederic Weisbecker , Ingo Molnar , John Stultz , Anton Vorontsov , Colin Cross , kernel-team@android.com, kgdb-bugreport@lists.sourceforge.net Subject: [RESEND PATCH v5 3.16-rc4 8/8] kdb: Allow access to sensitive commands to be restricted by default Date: Fri, 11 Jul 2014 12:33:38 +0100 Message-Id: <1405078418-14070-9-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1405078418-14070-1-git-send-email-daniel.thompson@linaro.org> References: <1399381429-16194-1-git-send-email-daniel.thompson@linaro.org> <1405078418-14070-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.220.178 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 Cc: kgdb-bugreport@lists.sourceforge.net --- 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 c670fe4..a11a26b 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..fbbcff6 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/kdb.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