From 23c8a5b7224dcc05a0793f409d16e695c04a5388 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 29 Apr 2013 11:50:35 -0700 Subject: 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 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. Original-Change-Id: Ic9646d5468183f4d8f94b5e5e1d2a727941d7bbe Reviewed-on: https://gerrit.chromium.org/gerrit/49537 Reviewed-by: Randall Spangler Tested-by: Vincent Palatin Commit-Queue: Vincent Palatin (cherry picked from commit 980df549794785ebadd2f4c26323e3f1bf3d3b02) Change-Id: I2c0c26eda540232f442c1d676ad311b8e29778f5 Reviewed-on: https://gerrit.chromium.org/gerrit/49637 Reviewed-by: Vic Yang Commit-Queue: Vincent Palatin Tested-by: Vincent Palatin --- common/console.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- cgit v1.2.1