From 2e0cc436b1f4cd60cdae8c4041b479d38ef8d774 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Tue, 21 Apr 2015 10:49:57 -0700 Subject: [PATCH] Allow console-reading host commands on locked systems We allow reading the EC console via case-closed debugging on locked systems, so we should also allow reading it via host command. The original reason for denying this (EC printing keystrokes) no longer exists; we don't print keyboard matrix changes by default anymore. BUG=chromium:479223 BRANCH=none (well, could apply this anywhere...) TEST=on a system with both hard and soft WP enabled in the EC, 'ectool console' works instead of failing with access denied. Change-Id: Ie111bc130dd3f17cd4b658718d00d299786e3434 Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/266701 Reviewed-by: Alec Berg Reviewed-by: Sameer Nanda --- common/uart_buffering.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/common/uart_buffering.c b/common/uart_buffering.c index 8037320340..42a925ae67 100644 --- a/common/uart_buffering.c +++ b/common/uart_buffering.c @@ -342,13 +342,6 @@ DECLARE_HOOK(HOOK_INIT, uart_rx_dma_init, HOOK_PRIO_DEFAULT); static int host_command_console_snapshot(struct host_cmd_handler_args *args) { - /* - * Only allowed on unlocked system, since console output contains - * keystroke data. - */ - if (system_is_locked()) - return EC_ERROR_ACCESS_DENIED; - /* Assume the whole circular buffer is full */ tx_snapshot_head = tx_buf_head; tx_snapshot_tail = TX_BUF_NEXT(tx_snapshot_head); @@ -379,13 +372,6 @@ static int host_command_console_read(struct host_cmd_handler_args *args) { char *dest = (char *)args->response; - /* - * Only allowed on unlocked system, since console output contains - * keystroke data. - */ - if (system_is_locked()) - return EC_ERROR_ACCESS_DENIED; - /* If no snapshot data, return empty response */ if (tx_snapshot_head == tx_snapshot_tail) return EC_RES_SUCCESS;