| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because of lacking CL:1501614 in octopus factory branch, dopefish
root key is written to some phaser360 devices. That will lead to
firmware updater not be able to verify RW vblock and AU will fail.
This CL will fix that by using root key info and model name to
make firmware updater get a proper sig_id so that in-field machines
can be updated by AU.
BUG=b:146876241, b:133901651, b:146482979
BRANCH=none
TEST=using a DUT of phaser360 (without whitelabel_tag = dopefish)
which is flashed dopefish rootkey and hwid, using command
'chromeos-firmwareupdate -m autoupdate --wp=1' to flash
firmware, RW firmware can be updated and DUT can boot normally.
Change-Id: I163c16189c28a996ed08bf2a7b162e6ee3b13be6
Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1981650
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
(cherry picked from commit 5ea8fe68b1d9c498b6f58303afa3e36cf025d280)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1992725
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Commit-Queue: Justin TerAvest <teravest@chromium.org>
Tested-by: Justin TerAvest <teravest@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We recently reactivated the -DUNROLL_LOOPS code for x86 devices.
Unfortunatley, this seems to lead to code size problems for early
firmware stages on certain x86 boards (CB:37475). The biggest speedup
with unrolled loops was observed during kernel verification anyway
(which hashes orders of magnitude more data than firmware verification),
so let's make this fully configurable by the calling firmware and only
enable it from depthcharge. Pre-RAM coreboot changes are probably better
served with the smaller implementation anyway (and this will only become
more important as we move to CBFS per-file hashing and need hash
algorithms in every stage).
BRANCH=None
BUG=None
TEST=None
Cq-Depend: chromium:1951413
Change-Id: I87eaa14299cae0ee0d0b4a098d638b6bccdaf75b
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1951782
Reviewed-by: Aaron Durbin <adurbin@google.com>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was for the Ryu project, which was cancelled (at least for
CrOS). It's safe to assume crossystem will never be used on Android.
BUG=chromium:990438
BRANCH=none
TEST=crossystem still functions on samus
Change-Id: Ide5b4ad105e9f36972067c125176ae5a08444ceb
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1949427
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
EC software sync should not be performed in recovery mode, as it breaks
the vboot model.
BUG=b:145310842
BRANCH=firmware-hatch-12672.B
TEST=Verify that EC sync is skipped in recovery mode (coreboot & depthcharge)
Change-Id: I771b970b044ed2b13a1cd79f5649af92b0177ac7
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1941037
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Stop magically checking get_info_flags by subtracting the
expected value from vbtlk_retval. Introduce two globals
vbtlk_expect_fixed and vbtlk_expect_removable which are
checked when the mocked VbTryLoadKernel function is called.
Update some comment style and fix spacing.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: I038aa03dcff24ec06f68f6a175f992ed99feddb9
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1836612
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added VB2_SECDATA_FWMP_DEV_FIPS_MODE flag which would enable FIPS 140-2/3
compliant behavior in Cr50. This includes power-up self tests, known
answer tests for cryptographic functions, etc.
BUG=b:138577491
TEST=make clean && make runtests
BRANCH=none
Change-Id: I37334aab82fc36e6beff1a8902867fe316f901b6
Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1947916
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than the caller picking and choosing between vb2_run_altfw
and vb2_try_alt_fw, always use the "try" function, and manually
specify the `allowed` argument.
Fix up some comment styles.
Reverse the order of vb2_commit_data and secdata_kernel_lock
calls, and check the return value of vb2_commit_data.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ib6b2752ba1b9be66401612a46f9c1b9353669c27
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1776286
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since power_button_state is only used within vboot_ui.c, it should be
declared static.
BRANCH=none
BUG=none
TEST=emerge-nami vboot_reference
Change-Id: I392f137af15b36cf343817c681b18434e33e53e4
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1937048
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Daisy snow has set its AUE version to R75 and R76 went stable for a long
time, so we can now remove the quirk for it.
BUG=None
TEST=make clean && make runtests
Change-Id: I8a955f1e02221c6562958f584dabdb27ab5d870d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1940401
Tested-by: Hung-Te Lin <hungte@chromium.org>
Auto-Submit: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In current kernel verification code, secdata reads and writes
are spread throughout the code. vboot2's design is to use
vb2_context.secdata_* for storing the state of secdata spaces,
and have the caller (depthcharge) read/save this field when
necessary.
Centralize secdata reads/writes into the functions of
secdata_tpm.c, previously known as rollback_index.c.
Functions which directly read/write to the TPM space are modified
to use vb2_secdata_*_get and vb2_secdata_*_set.
The secure spaces get read/flushed by functions in
vboot_api_kernel.c. These calls and the underlying functions
from secdata_tpm.c will eventually be relocated to depthcharge.
Create a new external function vb2ex_commit_data, which commits
any modified nvdata/secdata. Currently the depthcharge
implementation of this function only writes nvdata, but once
secdata TPM drivers have been migrated from vboot_reference to
depthcharge, it will also commit these data spaces.
This CL also removes the VbExNvStorageRead call from
vb2_kernel_setup, and the data is instead read in depthcharge
CL:1819379, right before calling VbSelectAndLoadKernel.
As such, both the VbExNvStorageRead and VbExNvStorageWrite
functions may be removed.
Finally, create a vb2_secdata_kernel_lock function, which should
be used right before attempting to leave vboot (by booting an OS
or chainloading to another firmware). This should eventually be
exposed as a vb2ex_ API function and relocated to depthcharge.
BUG=b:124141368, chromium:972956, chromium:1006689
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ifbfb21122af0bf85e22a6d3a0d48a1db7f7c25b7
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1819380, chromium:1939168
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728298
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unify "create a temp file and write firmware image contents" to the
new API get_firmware_image_temp_file with better error messages.
BRANCH=none
BUG=chromium:1024401
TEST=make clean && make runtests
Change-Id: I441f24053a8d94def587cf8270c44a4bdce9a4fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1928359
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Auto-Submit: Hung-Te Lin <hungte@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since vendor data flag in vb2_context is set from depthcharge directly
(CL:1933685), VB_SALK_INFLAGS_VENDOR_DATA_SETTABLE can be removed. The
inflags field is also removed from struct VbSelectAndLoadKernelParams.
BRANCH=none
BUG=chromium:953656
TEST=emerge-kukui depthcharge vboot_reference
Cq-Depend: chromium:1933685
Change-Id: If5cdf11d1fd27603b22b2c71183847a0987e5fc8
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1932279
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the recovery switch is physical then the propmt to enter dev mode
will say to press the recovery switch not the enter key. In this case we
do not want to warn the user that an internal keyboard is needed to
confirm we will just silently ignore the enter key.
BUG=b:144034020
TEST=On Drallion enter key does not work to switch to dev mode and does
not beep or print a warning when the enter key is pressed
BRANCH=none
Change-Id: I250ea2622c9c38bfc0d7463eb95ca65a12b41153
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1929601
Tested-by: Mathew King <mathewk@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Mathew King <mathewk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:124141368, chromium:1006689
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ieb47f54f665299b5377077c8975611ba3e1b8dc9
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1921775
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than depending on the architecture and environment to
provide the correct memory alignment (__BIGGEST_ALIGNMENT__),
hardcode to 8, which should be sufficient for all cases.
(Previously, by using __BIGGEST_ALIGNMENT__, this is set to
16 in all known cases, which is unnecessarily large.)
Update vb2_workbuf tests to be more flexible according to
VB2_WORKBUF_ALIGN value.
BUG=b:124141368
TEST=make clean && make runtests
TEST=Try values of VB2_WORKBUF_ALIGN=2,4,8,16,32,64
BRANCH=none
Change-Id: I819586119fa3102fa423a01e0737e6864c05d752
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1911921
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After storing the GBB header on the workbuf, the offset of wb.buf
is stored into workbuf_used by incorrectly using ctx as the
pointer base, rather than sd (which corresponds to the start of
the workbuf). This subtracts 8 bytes from the correct value of
workbuf_used, and leaves the last 8 bytes of the GBB header
vulnerable to being overwritten with any VB2_WORKBUF_ALIGN values
less than 16.
Also update the relevant vb2_misc_tests check to account for
GBB headers with non-aligned sizes (currently it is 128 bytes).
BUG=b:124141368, chromium:1027846
TEST=Test with various VB2_WORKBUF_ALIGN values
BRANCH=none
Change-Id: I862d29155ce08df6911c277f8ce8c703ffaf1df7
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1932276
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The updater_utils.c should not deal with updater_config directly.
Currently everything relates to generating temporary files will need
updater_config due to updater_create_temp_file. By moving that out (let
every caller to pass &cfg->tempfiles) we can detach updater_utils.c from
updater_config.
BRANCH=none
BUG=chromium:1024401
TEST=make clean && make runtests
Change-Id: I44bc4df0152596a822b1e0672f41c16825472249
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1928358
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Auto-Submit: Hung-Te Lin <hungte@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The "EC update" (either calling flashrom or using EC RO software sync)
logic has been bloated and is really not a typical updater feature (that
only makes sense for dogfooders). And we have seen enough special cases
that some boards may not want to use it (or causing problems).
Move that to a quirk so we can turn on or off in a more flexible way.
BRANCH=none
BUG=chromium:1024401
TEST=make clean && make runtests
Change-Id: I2d4fe0d9ee0d98ad41b8cbdcaff848846d120d07
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1926010
Reviewed-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Auto-Submit: Hung-Te Lin <hungte@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The firmware updater (updater.c) is bloated so we should move functions
that are not really related to 'updating logic' to a new file,
updater_utils.c.
Refactor only by moving functions (and renamed few functions), no
changes in updater logic.
BRANCH=none
BUG=chromium:1024401
TEST=make clean && make runtests
Change-Id: I98339c5c4a81845b36daf842c79625fa2389c7f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1926009
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Auto-Submit: Hung-Te Lin <hungte@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When flashing using CCD, we should:
- Set programmer to raiden_debug_spi:target=AP
- Set write protection argument to "0" instead of number 0 (which means NULL).
- do_check_compatible_tpm_keys should not raise failure if force_update is set.
BRANCH=None
BUG=None
TEST=make runtest;
sudo futility update --ccd -i image.bin
Change-Id: I01121791bbbae0ffbcbc7a56c24b506d48ef7394
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1926011
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Auto-Submit: Hung-Te Lin <hungte@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default in pre-upload.py was changed to warn about Signed-Off-By
lines: https://crrev.com/c/1917972.
BRANCH=none
BUG=none
TEST=repo upload --cbr .
Change-Id: Ie54b95251a751134c8824d3720e2fe73ef79fbc9
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1926520
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently VB_SALK_INFLAGS_ENABLE_DETACHABLE_UI in
VbSelectAndLoadKernelParams.inflags controls whether to enable
detachable ui. However, it doesn't have much to do with the specifics of
"loading a kernel", and would fit better in vb2_context.flags, which is
also passed to VbSelectAndLoadKernel().
This patch replaces the usage of VB_SALK_INFLAGS_ENABLE_DETACHABLE_UI
with vb2_context_flags VB2_CONTEXT_DETACHABLE_UI, which is set from
depthcharge.
BRANCH=none
BUG=chromium:953656
TEST=emerge-kukui depthcharge vboot_reference
Cq-Depend: chromium:1918868
Change-Id: Iafe0f9fe0a90bcb5a7fa557fac75e0856796769d
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1921769
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TEST=Able to save ~50ms of bootime with this CL
Without this CL
1100:finished vboot kernel verification 802,443 (148,108)
With this CL
1100:finished vboot kernel verification 775,914 (102,601)
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Change-Id: I96bea22667ebf45b446a26d84de96e52f3d28aa0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1919094
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CL:1900560 broke MOCK_TPM due to a typo in the Makefile. This patch
fixes it.
BRANCH=None
BUG=None
TEST=None
Change-Id: Ifd23ad764029b72af3fb03cf9dd52faefa586a80
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1922491
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch splits out the TPM functionality into a separate library called
TLCL (TPM lightweight command library). This is to avoid linking in TLCL
code two times and causing duplicate references.
BUG=none
BRANCH=none
TEST=make clean && make runtests
Cq-Depend: chromium:1901882
Change-Id: I56e961c066b2df1d1e19f632b834b11625454f59
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1900560
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike STM32 (used on ARM Chromebooks), EC images on most x86
Chromebooks used to have a header before EC_RO section describing the
size and attributes of firmware to load. However, partial updating with
only 'EC_RO' by flashrom will not include those data. So we should use
'WP_RO' to update whole RO area.
This also implies EC RO software sync, which usually only updates
ec.RO.bin in EC_RO, is not safe on devices with extra data. A quick
solution is to only allow RO software sync when EC_RO is aligned to top
of EC firmware image. Also in future devices cannot run EC software sync
may skip generating EC RO blobs in AP coreboot CBFS so the updater won't
try to do RO software sync.
BUG=chromium:1024401
TEST=(kukui) chromeos-firmwareupdate --mode=recovery # updated and boot
(laser) chromeos-firmwareupdate --mode=recovery # updated and boot
also verified we can update from old x86 EC (EC_RO does not
include header) to new style (EC_RO contains header).
Change-Id: I2c90320ffbfd79ba0cbaf70016446d8ab489e6ac
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1919097
Reviewed-by: Shelley Chen <shchen@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
chromeos-tpm-recovery only works when it's actually booted in recovery
mode, not when just running a recovery image in developer mode with
Ctrl+U. This distinction is often not super clear to non-firmware
people, so make the error message more explicit.
BRANCH=None
BUG=None
TEST=None
Change-Id: I18afa933f624f26d1f7949b9b586ab01daf7c801
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1913491
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, battery cutoff is handled at the end of a successful EC
software sync. Now that auxiliary firmware sync is separate from the
EC, this patch moves it back to after both EC and auxfw updates are
successful, to ensure all firmware is up-to-date before entering ship
mode.
BUG=none
BRANCH=none
TEST=make runtests
Change-Id: I96bea22667ebf45b446a26d84de96e52f3d289a5
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1889430
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:143094352
BRANCH=none
TEST=make clean && make runtests
Change-Id: I3665bfb10c66e2fbe3906e99cc72346748123cfb
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1873879
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new flag can be set by any firmware which updates the EC to let
further stages know that the EC sync has already been completed during
this boot.
BUG=none
BRANCH=none
TEST=make runtests
Change-Id: Ide14efe7091631b62d240ddc984c8c70527a6d37
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1877066
Reviewed-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
crossystem functions just make up a fake vb2_context for calling into
things like vb2_nv_init(), but that function actually accesses
vb2_shared_data as well. This used to work because vb2_get_sd() would
return NULL in that case and vb2_nv_init() actually checks for that,
but with the persistent context model this is no longer possible and
making up directly allocated contexts is always illegal.
This patch adds a small fake workbuffer to the fake context so we can
have real backing storage for shared data. (This might not be the final
way we want to fix it but should work as a quick band-aid over the
crashes.)
Also remove the now pointless (sd == NULL) checks from vb2_nv_init().
BRANCH=None
BUG=chromium:1024732
TEST=make runtests
Change-Id: I91247013f092bbfc41cf1974b82cf70a29fa4734
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1917486
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Brian Norris <briannorris@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch separates out some code into an extra file so that it's
easier to link into hostlib without pulling in all additional
dependencies from the random 2misc.c crap. The functions are copied
wholesale with no changes.
BRANCH=None
BUG=chromium:1024732
TEST=make runtests
Change-Id: Ia00d1da277e5fc0956c8a1ae608d842224016c91
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1917819
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Brian Norris <briannorris@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This callback is redundant, because vboot takes the buffer pointer and
just passes it straight into vb2ex_ec_update_image(), so clearly the
platform must be able to find the image on its own. Remove it, and also
remove the arguments to vb2ex_ec_update_image which were the image and
its size.
BUG=none
BRANCH=none
TEST=make runtests
Cq-Depend: chromium:1910562
Change-Id: I35548cc0bde761cf08337489af0772bbdf46de4d
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1877065
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the logic for updating auxfw is entangled with the logic
for performing EC software sync. This patch attempts to split them
apart, so that they can be used separately. VbSelectAndLoadKernel()
currently still performs both, EC first and then auxfw. The intended
use-case for this functionality is to perform EC software sync only in
coreboot's romstage. Unit tests were updated to ensure functionality
is effectively unchanged.
BUG=b:143094352, chromium:1016688
BRANCH=none
TEST=make clean && make runtests
Change-Id: I7bdf38694cfed83b18dd8189b8516780184ecc8e
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1867314
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove devidx argument from internal and external functions.
Rename external API functions to vboot2 scheme (vb2ex_...).
Rename external EC-related data types to vboot2 scheme (vb2_...).
BUG=b:124141368, chromium:1016688, chromium:1017093, b:112198832, b:143094352
TEST=make clean && make runtests
BRANCH=none
Cq-Depend: chromium:1910562
Change-Id: I4ca9858a0f91a0365288c04cdb90aad0efdd7647
Signed-off-by: Joel Kitching <kitching@google.com>
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1872255
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The EC RO name inside CBFS is actually 'ecro' instead of 'ec_ro'.
BRANCH=None
BUG=b:141965252
TEST=make clean && make runtests
Run 'futility update -i image.bin -e ec.bin --mode=recovery'
Change-Id: I2ede0bfbd550d343726df893ce707e82d77d5f30
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1913689
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also standardize on position and spacing of __attribute__.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ic61d6193c2413824837a51af98eb2dcd9ea4ab85
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1902843
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When unpacking files, unzip will retain timestamps on the outputs.
This makes it easy to recreate the firmware unpacker with the same
exact contents. futility doesn't copy update timestamps anywhere,
so all the mtimes are $now, which makes it impossible to recreate
the same archive.
Update the API to pass around mtimes by reading them from inputs,
setting them on outputs, and copying them across.
BUG=None
TEST=`futility update -a chromeos-firmwareupdate --unpack out` has timestamps on outputs
BRANCH=None
Change-Id: Icc0ae833390115082e1677d190d1b2a029b78439
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1913067
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All devices which have a PD chip running CrOS EC code have already shipped,
and there is no intention to go back to using an "EC" for a TCPC anymore.
BUG=b:143762298,chromium:1017093
BRANCH=none
TEST=make runtests
Change-Id: I177c00581089de59e4f35608b97ef5432e8b492b
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1895712
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes an issue discovered while fuzzing
vb2_load_fw_keyblock(): the data key contained in the keyblock is not
sanity-checked before moving it around on the work buffer, resulting in
a potential overflow if it's key_size flows over the end of the
keyblock. This is not exploitable since the keyblock was already
verified, so only signed (=trusted) keyblocks can get to this stage, but
there's nothing wrong with double-checking anyway.
This patch also rewrites the data_key moving code a bit to just move the
whole key rather than individually copying the header elements and then
just memmove()ing the data (and keeping the previous key_offset from the
root key rather than the one from the data key). None of these issues
affect correctness but it seems simpler and cleaner to me this way.
Finally, remove an instance where the keyblock was accessed after the
memmove(). This would be bad if the data key was so much larger than the
keyblock that memmove()ing it overwrites the keyblock header. Like an
existing comment points out, that doesn't happen with the key sizes we
choose in practice, but it's still better to not rely on that.
BRANCH=none
BUG=chromium:1017793
TEST=make runtests and reran failing fuzz testcase
Change-Id: I78ded43ad999e0883a69cbb2ea7e876888a9fa22
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1880015
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move vb2_context to live inside of vb2_shared_data, instead of
in a separate memory space allocated by the caller.
See design doc:
http://go/vboot2-persistent-context
BUG=b:124141368, chromium:994060
TEST=make clean && make runtests
BRANCH=none
Change-Id: If2421756572a43ba58b9da9f00e56a8f26ad3ad5
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1874753, chromium:1902339
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1716351
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following sections can be now deleted from hard-coded list:
- RO_PRESERVE: no boards use it.
- RO_FSG: new images have set the PRESERVE flag in CBFS.
- SI_GBE, SI_PDR: already using PRESERVE flag since fw branch is cut.
BUG=b:116326638,chromium:936768
TEST=make clean && make runtests
Change-Id: I99759949104bf4f1c1db3556e273923dcb1c5887
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1902841
Tested-by: Hung-Te Lin <hungte@chromium.org>
Auto-Submit: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After informing EC of the mode chosen by vboot, it is stored
in a global and never accessed again. Remove this function,
its calls, and its tests.
Also note some significant issues which existed:
(1) Using accessor VbGetMode for tests, rather than just
overriding VbExEcEnteringMode when needed.
(2) The tests checking the value sent to VbExEcEnteringMode
(vboot_api_kernel2_tests and vboot_detach_menu_tests)
actually call the function themselves.
BUG=b:124141368, chromium:1014379
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ib8e510a1e1c663bb3f8238a9ad15e3e64d7350b0
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1864533
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1830239
Reviewed-by: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 6a703f5b0edfdbf2eee72d59499f73585262a46f.
Reason for revert: This change breaks building coreboot
Original change's description:
> Clean up implicit fall through.
>
> Directly use the __attribute__ ((fallthrough)) instead of
> a macro.
> This was suggested in CL:1772474.
>
> BUG=chromium:997709
> TEST=CQ
> BRANCH=None
>
> Change-Id: Ic6cd417d7c735395a4b136dbb0879a6f1716da98
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1897360
> Tested-by: Manoj Gupta <manojgupta@chromium.org>
> Reviewed-by: Julius Werner <jwerner@chromium.org>
> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Bug: chromium:997709
Change-Id: Icd0de8bcdee44d1b41f313a4f5aaba8108f734ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1899735
Reviewed-by: Mathew King <mathewk@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
Tested-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Directly use the __attribute__ ((fallthrough)) instead of
a macro.
This was suggested in CL:1772474.
BUG=chromium:997709
TEST=CQ
BRANCH=None
Change-Id: Ic6cd417d7c735395a4b136dbb0879a6f1716da98
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1897360
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up the code.
BUG=none
BRANCH=none
TEST=N/A
Change-Id: If4ef76edf5f97fc51a21740e1ca51475b27b5f1a
Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1897416
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you read the manpage for printf *really* closely, it seems that the
%#x token only prints the 0x prefix for non-zero values. Huh... never
knew that (and our firmware implementations in fact don't honor that,
but glibc does). Anyway, I think we're fine with either behavior but
this broke the expected output for one of our futility tests, which this
patch fixes (originally broken in CL:1840191).
BRANCH=None
BUG=None
TEST=make runtests
Change-Id: Id54ff6f56e02333ab01b09b75deb16f47da01bc3
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1885411
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes a sanitizer issue in cgpt where a GPT entries array may
have been passed even though it was not loaded from disk (parsing an
uninitialized buffer). The GPT library seems to have been written with
the assumption that both headers and entries would always be loaded and
it could recover even if only the primary header and the secondary
entries were valid. In practice, this doesn't really work because the
caller doesn't know how to read entries for an invalid header.
Therefore, change the code so that entries are only assumed to be loaded
for valid headers.
Also fix some minor problems with loading GPTs by aligning sizes up (not
down) to the next sector boundary and making sure we always allocate the
maximum amount of space for entry arrays, even if the current header may
not need that much (in case a repair wants to overwrite it).
This practically reverts CL:276766 which becomes obsolete (and was
really just a dirty hack to hide an underlying problem).
BRANCH=none
BUG=chromium:1017797
TEST=make runtests
Change-Id: I86c601dc074261d53f013b98ae214efdc44f3563
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1885098
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds checks necessary before various types of images
signing could proceed.
The checks include verifying that Board ID flags and major version
number match the image type.
Also, manifest modification for node locked images is enhanced by
setting the least significant bit of the tag field to one. This will
ensure that the prod key ladder is not available to node locked images
even though they are signed with a prod key.
BRANCH=none
BUG=b:74100307
TEST=verified various cases by manually editing prod.json and
signing_instructions.sh and observing results: either error
messages or successful modification of the manifest and signing.
Change-Id: I0bc4a8acae1ca4e983999fd47e515c48786ded6c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1894848
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Node locked images signed by the builder will have to come from the
factory branch and have version of 0.3.22.
Signing manifest will be processed to insert Device ID values, remove
Board ID values and set the top bit of config1.
BRANCH=none
BUG=b:74100307
TEST=ran the script manually with proper input and verified that
manifest is processed as expected.
Change-Id: Ib8cbe0f1ae31e79c3228a662c02231caeb901adc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1880572
Tested-by: George Engelbrecht <engeg@google.com>
Reviewed-by: Ned Nguyen <nednguyen@google.com>
Reviewed-by: George Engelbrecht <engeg@google.com>
Commit-Queue: George Engelbrecht <engeg@google.com>
|