From: Daniel Thompson <daniel.thompson@linaro.org>
To: Jason Wessel <jason.wessel@windriver.com>
Cc: Daniel Thompson <daniel.thompson@linaro.org>,
kgdb-bugreport@lists.sourceforge.net,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>, Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>, Colin Cross <ccross@android.com>,
kernel-team@android.com, patches@linaro.org,
linaro-kernel@lists.linaro.org,
John Stultz <john.stultz@linaro.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
Anton Vorontsov <anton.vorontsov@linaro.org>
Subject: [RESEND PATCH v5 3.19-rc2 0/8] kdb: Allow selective reduction in capabilities
Date: Wed, 7 Jan 2015 16:34:50 +0000 [thread overview]
Message-ID: <1420648498-17428-1-git-send-email-daniel.thompson@linaro.org> (raw)
In-Reply-To: <1399381429-16194-1-git-send-email-daniel.thompson@linaro.org>
Jason:
This patchset is already integrated into kgdb-next and I'm only really
posted it for completeness. The rebase from v3.18-rc3 to v3.19-rc2 was
trivial (no conflicts at all) so you can probably just stick with what
you already have in kgdb-next.
This patchset implements restricted modes for the KDB debugger. These
can be used to provide some diagnostic capability to a users with access
to the debug console without giving unrestricted access to the system.
There are no outstanding review comments for this patchset.
Most obvious use cases are to realize a diagnostic mode to tackle
in-the-field failures of systems such as mobile phones, web kiosks or
embedded devices. A concrete example is the serial debugger found in
some android devices which is typically multiplexed over the headphone
or USB socket. Currently Android cannot use kdb for this purpose
because it introduces risks to user data if the phone were connected to
"evil" audio hardware.
The feature is conceptually similarly to the existing code to mask the
available magic SysRq commands. For this reason it is implemented in a
similar way with modes for disable-all (0), enable-all(1) and a bitmask
to enable/disable groups of functionality.
The implementation of the mask check includes a feature to allow a
command to change which group it belongs to based on whether or not the
command has arguments (for example, go without arguments is a very safe
command whilst go with an argument allows arbitrary changes to the
program counter).
There are a few patches, some are just cleanups, some are churn-ish
cleanups, but inevitable. And the rest implements the mode -- after all
the preparations, everything is pretty straightforward.
Changes since v4:
* Drop patches to avoid deadlock on sysrq spin lock (Rik van Riel's
984d74a72076... is a much better approach).
Changes since v3:
* Improved commenting on safety of calls to __handle_sysrq_nolock
* Remove magic shift value in the command categorization values and
expressed the flags using shifts to make code review of the defined
shift value easier.
Changes since v2:
* Fixed stupid build error when CONFIG_KDB[_KIOSK]_DEFAULT_ENABLE was not
defined.
* Increase flexibility by allowing the userspace greater control over the
commands to be restricted.
* Removed the "kiosk" terminology. Its confusing.
Changes since v1 (circa 2012):
* ef (Display exception frame) is essentially an overly complex peek
and has therefore been marked unsafe
* bt (Stack traceback) has been marked safe only with no arguments
* sr (Magic SysRq key) honours the sysrq mask when called in kiosk
mode
* Fixed over-zealous blocking of macro commands
* Symbol lookup is forbidden by kdbgetaddrarg (more robust, better
error reporting to user)
* Fix deadlock in sr (Magic SysRq key)
* Better help text in kiosk mode
* Default (kiosk on/off) can be changed From the config file.
Anton Vorontsov (6):
kdb: Remove currently unused kdbtab_t->cmd_flags
kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags
kdb: Rename kdb_register_repeat() to kdb_register_flags()
kdb: Use KDB_REPEAT_* values as flags
kdb: Remove KDB_REPEAT_NONE flag
kdb: Add enable mask for groups of commands
Daniel Thompson (2):
kdb: Categorize kdb commands (similar to SysRq categorization)
kdb: Allow access to sensitive commands to be restricted by default
include/linux/kdb.h | 62 ++++++++--
kernel/debug/kdb/kdb_bp.c | 37 +++---
kernel/debug/kdb/kdb_main.c | 263 ++++++++++++++++++++++++++---------------
kernel/debug/kdb/kdb_private.h | 3 +-
kernel/trace/trace_kdb.c | 4 +-
lib/Kconfig.kgdb | 25 ++++
6 files changed, 271 insertions(+), 123 deletions(-)
--
1.9.3
next prev parent reply other threads:[~2015-01-07 16:35 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 15:43 [RFC v2 00/10] kdb: Kiosk (reduced capabilities) mode Daniel Thompson
2014-04-02 15:43 ` [RFC v2 01/10] sysrq: Implement __handle_sysrq_nolock to avoid recursive locking in kdb Daniel Thompson
2014-04-02 15:43 ` [RFC v2 02/10] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-04-02 15:43 ` [RFC v2 03/10] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-04-02 15:43 ` [RFC v2 04/10] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-04-02 15:43 ` [RFC v2 05/10] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-04-02 15:43 ` [RFC v2 06/10] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-04-02 15:43 ` [RFC v2 07/10] kdb: Mark safe commands as KDB_SAFE and KDB_SAFE_NO_ARGS Daniel Thompson
2014-04-02 15:43 ` [RFC v2 08/10] kdb: Add kiosk mode Daniel Thompson
2014-04-02 15:43 ` [RFC v2 09/10] kdb: Improve usability of help text when running in " Daniel Thompson
2014-04-02 15:44 ` [RFC v2 10/10] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-04-25 16:29 ` [RFC v3 0/9] kdb: Allow selective reduction in capabilities (was "kiosk mode") Daniel Thompson
2014-04-25 16:29 ` [RFC v3 1/9] sysrq: Implement __handle_sysrq_nolock to avoid recursive locking in kdb Daniel Thompson
2014-04-25 16:45 ` Steven Rostedt
2014-04-28 10:24 ` Daniel Thompson
2014-04-28 17:44 ` Colin Cross
2014-04-28 20:12 ` Daniel Thompson
2014-04-29 8:59 ` Daniel Thompson
2014-04-29 16:33 ` Colin Cross
2014-04-25 16:29 ` [RFC v3 2/9] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-04-25 16:29 ` [RFC v3 3/9] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-04-25 16:29 ` [RFC v3 4/9] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-04-25 16:29 ` [RFC v3 5/9] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-04-25 16:29 ` [RFC v3 6/9] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-04-25 16:29 ` [RFC v3 7/9] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-04-25 16:57 ` Steven Rostedt
2014-04-28 10:30 ` Daniel Thompson
2014-04-25 16:29 ` [RFC v3 8/9] kdb: Add enable mask for groups of commands Daniel Thompson
2014-04-25 16:29 ` [RFC v3 9/9] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 0/9] kdb: Allow selective reduction in capabilities (was "kiosk mode") Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 1/9] sysrq: Implement __handle_sysrq_nolock to avoid recursive locking in kdb Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 2/9] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 3/9] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 4/9] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 5/9] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 6/9] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 7/9] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 8/9] kdb: Add enable mask for groups of commands Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 9/9] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 0/8] kdb: Allow selective reduction in capabilities (was "kiosk mode") Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 4/8] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 5/8] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 6/8] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 7/8] kdb: Add enable mask for groups of commands Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 8/8] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 0/8] kdb: Allow selective reduction in capabilities Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 4/8] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 5/8] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 6/8] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 7/8] kdb: Add enable mask for groups of commands Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 8/8] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-07-11 13:16 ` [RESEND PATCH v5 3.16-rc4 0/8] kdb: Allow selective reduction in capabilities Jason Wessel
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 " Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 4/8] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 5/8] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-08-19 14:02 ` [RESEND PATCH v5 3.17-rc1 6/8] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-08-19 14:02 ` [RESEND PATCH v5 3.17-rc1 7/8] kdb: Add enable mask for groups of commands Daniel Thompson
2014-08-19 14:02 ` [RESEND PATCH v5 3.17-rc1 8/8] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2015-01-07 16:34 ` Daniel Thompson [this message]
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 4/8] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 5/8] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 6/8] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 7/8] kdb: Add enable mask for groups of commands Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 8/8] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420648498-17428-1-git-send-email-daniel.thompson@linaro.org \
--to=daniel.thompson@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=anton.vorontsov@linaro.org \
--cc=ccross@android.com \
--cc=fweisbec@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jason.wessel@windriver.com \
--cc=john.stultz@linaro.org \
--cc=jslaby@suse.cz \
--cc=kernel-team@android.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=patches@linaro.org \
--cc=rostedt@goodmis.org \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).