From patchwork Thu Jun 19 13:19:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 32224 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B1564206A0 for ; Thu, 19 Jun 2014 13:20:23 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id y20sf16484026ier.1 for ; Thu, 19 Jun 2014 06:20:23 -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=TlmSSRt0eDz1JKDzpxc7RM//W8R2vANhyF+CVq2egPfmYX7S+iS2ommibq/U4b4XT8 4S5lRGEdMWFi6S6Ew4AZqosqZxcDOxxldoccYMhriqlgLOQCjb8WWZdiGyX4+pejH7U0 WMfPoOjPJqPpc/GHVGENJCTQQA1/O8Hz9jYBMMm4GWKqqFKz5wbXqNCSxGmCXxiDTxDX RO2xf18kO1IApPGrzrnqZwIA2o4mg/Ll18PONxPdorJwolwYLduFUZmGQz96v650x6H+ kqyCrG1XhwQO3yZ+hd2a6Tz3zzBpu+GBjP4R1fV8UH1GffLteY43mUBvUWHfkQSXDD+5 PRsQ== X-Gm-Message-State: ALoCoQkbychYyJGCuHkeKwSVUYH7CEYGoAOlsvbysuk4Kg4BStqoh4WB9j1Xa1Ahyub7depMdiVR X-Received: by 10.182.128.166 with SMTP id np6mr2378719obb.16.1403184023241; Thu, 19 Jun 2014 06:20:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.201 with SMTP id k67ls547666qge.22.gmail; Thu, 19 Jun 2014 06:20:23 -0700 (PDT) X-Received: by 10.58.230.101 with SMTP id sx5mr4010939vec.10.1403184023062; Thu, 19 Jun 2014 06:20:23 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id pu15si2347098vdb.94.2014.06.19.06.20.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Jun 2014 06:20:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id ij19so2179714vcb.36 for ; Thu, 19 Jun 2014 06:20:23 -0700 (PDT) X-Received: by 10.58.220.230 with SMTP id pz6mr3886318vec.9.1403184022951; Thu, 19 Jun 2014 06:20:22 -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.54.6 with SMTP id vs6csp361299vcb; Thu, 19 Jun 2014 06:20:22 -0700 (PDT) X-Received: by 10.152.207.11 with SMTP id ls11mr1831053lac.62.1403184021832; Thu, 19 Jun 2014 06:20:21 -0700 (PDT) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by mx.google.com with ESMTPS id df8si7245996wjc.1.2014.06.19.06.20.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Jun 2014 06:20:21 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.180 as permitted sender) client-ip=209.85.212.180; Received: by mail-wi0-f180.google.com with SMTP id hi2so2845469wib.1 for ; Thu, 19 Jun 2014 06:20:21 -0700 (PDT) X-Received: by 10.194.84.101 with SMTP id x5mr5037422wjy.52.1403184021167; Thu, 19 Jun 2014 06:20:21 -0700 (PDT) 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 m3sm11538652wik.7.2014.06.19.06.20.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jun 2014 06:20:20 -0700 (PDT) From: Daniel Thompson To: kgdb-bugreport@lists.sourceforge.net, 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 Subject: [PATCH v5 8/8] kdb: Allow access to sensitive commands to be restricted by default Date: Thu, 19 Jun 2014 14:19:37 +0100 Message-Id: <1403183977-3454-9-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1403183977-3454-1-git-send-email-daniel.thompson@linaro.org> References: <1399381429-16194-1-git-send-email-daniel.thompson@linaro.org> <1403183977-3454-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.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 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