diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2013-04-29 11:50:35 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-30 11:45:58 -0700 |
commit | 980df549794785ebadd2f4c26323e3f1bf3d3b02 (patch) | |
tree | a63127272d033538d1e76d816d22972aa92cd765 | |
parent | 0a6b7620d6b4ba1a50500a75db3e76162eac5ce0 (diff) | |
download | chrome-ec-980df549794785ebadd2f4c26323e3f1bf3d3b02.tar.gz |
add option to de-activate EC console input when WP is on
With a Toad cable, the user can access the EC serial console through the
micro-B connector.
We probably need to de-activate the input on the EC serial console when
the Write-Protect is on, since we have fairly "powerful" commands on the
EC command-line.
Add a new CONFIG_CONSOLE_RESTRICTED_INPUT on platforms with externally
accessible EC serial port.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:18716
TEST=on Spring with CONFIG_CONSOLE_RESTRICTED_INPUT set, try with and without
write-protect, use successfully the EC console in the former case, and see
"Console is DISABLED" in the latter case.
Change-Id: Ic9646d5468183f4d8f94b5e5e1d2a727941d7bbe
Reviewed-on: https://gerrit.chromium.org/gerrit/49537
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | common/console.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c index f25e9ec469..e7b4564dcb 100644 --- a/common/console.c +++ b/common/console.c @@ -7,6 +7,7 @@ #include "console.h" #include "link_defs.h" +#include "system.h" #include "task.h" #include "uart.h" #include "util.h" @@ -164,6 +165,15 @@ void console_has_input(void) void console_task(void) { +#ifdef CONFIG_CONSOLE_RESTRICTED_INPUT + /* the console is not available due to security restrictions */ + if (system_is_locked()) { + ccprintf("Console is DISABLED (WP is ON).\n"); + while (1) + task_wait_event(-1); + } +#endif + console_init(); while (1) { |