New issue
Advanced search Search tips

Issue 658207 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature



Sign in to add a comment

Report firmware write protect status via UMA

Project Member Reported by mnissler@chromium.org, Oct 21 2016

Issue description

There've been several incidents causes by accidental loss of firmware write protection. Let's add a UMA histogram to track the frequency of this happening in the wild.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/da18f697075549514143b425d3f407d43b2f9e9c

commit da18f697075549514143b425d3f407d43b2f9e9c
Author: David Hendricks <dhendrix@chromium.org>
Date: Sat Oct 22 00:49:49 2016

Make extract_param() not change the input buffer

extract_param() was introduced many years ago in upstream and has
always removed the "needle" from the "haystack".

The best reason for that approach is to detect if there are unused
parameters specified which could be an indication that the user
misspelled a parameter or some other silly mistake.

More importantly though, multiple programmers init functions should
be able to parse the same parameters so that if init for one device
fails, we can gracefully fall thru to try another which may use the
same parameters. This is especially true for the ECs we support.

Long-term, the fix should be to parse the programmer parameters
into a linked list so that we can detect unused parameters, detect
duplicate parameters, and possibly other useful things. In the short-
term though we need to make extract_param() non-destructive.

BUG= chromium:658207 
BRANCH=none
TEST=tested on reef with follow-up patch

Change-Id: I824be388cc3b094c889683f71485a8af6b760006
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/402057
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/da18f697075549514143b425d3f407d43b2f9e9c/flashrom.c

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/cef8eb3caf969bfdc729c9ef1ce54714cb8c971f

commit cef8eb3caf969bfdc729c9ef1ce54714cb8c971f
Author: David Hendricks <dhendrix@chromium.org>
Date: Sat Oct 22 00:42:00 2016

cros_ec_*: Err out if non-EC type parameter is used for LPC/I2C

CrOS ECs come in a few diffrent varieties now: EC, PD, and SH. The way
things evolved over time we never really worried about what happens
if the user specifies pd or sh as the EC type on a system with an LPC
or I2C CrOS EC.

Consequently "-p ec:type=<sh|pd>" causes flashrom to get confused and
act as though "-p ec:type=ec" was used if the EC is I2C or LPC. This
probably doesn't matter for most cases (firmware read/write) since the
sizes would mismatch or some other obvious failure would occur, but
other commands could return information about the EC instead of the
device the user intends to target.

BUG= chromium:658207 
BRANCH=none
TEST=tested on reef, "flashrom -p ec:type=" fails when pd or sh are
specified.

Change-Id: I7d0d2969ce7ddd707cefae1f5c6c5d38c7c7b935
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/402058
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/cef8eb3caf969bfdc729c9ef1ce54714cb8c971f/cros_ec_i2c.c
[modify] https://crrev.com/cef8eb3caf969bfdc729c9ef1ce54714cb8c971f/cros_ec_lpc.c

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/2b56e472a4071cd3db188ce65da8b767989d18dc

commit 2b56e472a4071cd3db188ce65da8b767989d18dc
Author: David Hendricks <dhendrix@chromium.org>
Date: Sat Oct 22 02:05:21 2016

Non-CrOS ECs: Err out if non-EC type parameter is used

Similar to the previous patch, this adds programmer parameter
parsing to non-CrOS ECs so that we can err out if an "ec" type
device is not the intended target.

BUG= chromium:658207 
BRANCH=none
TEST=Tested that "-p ec:type=" fails on Parrot (ENE EC) if pd or
sh are specified as the type.

Change-Id: Ic23d68f75226b947f35d49baa1c0fa0c83a15f3f
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/402059
Reviewed-by: Shawn N <shawnn@chromium.org>

[modify] https://crrev.com/2b56e472a4071cd3db188ce65da8b767989d18dc/ene_lpc.c
[modify] https://crrev.com/2b56e472a4071cd3db188ce65da8b767989d18dc/it85spi.c
[modify] https://crrev.com/2b56e472a4071cd3db188ce65da8b767989d18dc/mec1308.c
[modify] https://crrev.com/2b56e472a4071cd3db188ce65da8b767989d18dc/wpce775x.c

Status: Started (was: Assigned)
https://chromium-review.googlesource.com/#/c/400739/
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/aa1d248e2f0145d57c1ae06f8145c7846c4ac7c6

commit aa1d248e2f0145d57c1ae06f8145c7846c4ac7c6
Author: Mattias Nissler <mnissler@chromium.org>
Date: Fri Oct 21 13:44:13 2016

init: Report boot mode metrics

This adds UMA histograms for boot mode, including (1) firmware write
protect switch status, (2) dev switch status, (3) main firmware write
protect status, (4) EC firmware write protect status and (5) PD
firmware write protect status.

BUG= chromium:658207 
TEST=Ran on a device and observed samples in chrome://histograms
CQ-DEPEND=CL:402059

Change-Id: I750435f6598588aa077eff63e20f78c6f342ad6a
Reviewed-on: https://chromium-review.googlesource.com/400739
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>

[add] https://crrev.com/aa1d248e2f0145d57c1ae06f8145c7846c4ac7c6/init/send-boot-mode.conf

Project Member

Comment 6 by bugdroid1@chromium.org, Oct 31 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/64815089e2fbe13e92661d8c81d7c6c05c6b172e

commit 64815089e2fbe13e92661d8c81d7c6c05c6b172e
Author: mnissler <mnissler@chromium.org>
Date: Mon Oct 31 09:49:30 2016

Add histogram definitions for Chrome OS boot mode.

This adds enum type definitions and histogram declarations for boot
mode metrics recorded by the Chrome OS boot process. See also
https://chromium-review.googlesource.com/#/c/400739

BUG= chromium:658207 
TEST=None

Review-Url: https://codereview.chromium.org/2445993005
Cr-Commit-Position: refs/heads/master@{#428670}

[modify] https://crrev.com/64815089e2fbe13e92661d8c81d7c6c05c6b172e/tools/metrics/histograms/histograms.xml

Status: Fixed (was: Started)

Comment 8 by dchan@google.com, Jan 21 2017

Labels: VerifyIn-57

Comment 9 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 10 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 11 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61

Comment 13 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)

Sign in to add a comment