-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WiP: t480 boots without known regressions #1906
Open
tlaurion
wants to merge
49
commits into
linuxboot:master
Choose a base branch
from
tlaurion:poc_t480
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7,649
−161
Open
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
bce1881
Add additional coreboot version for T480
akunterkontrolle ca1bd20
Add coreboot patches for T480
akunterkontrolle b101d31
Add coreboot config for T480
akunterkontrolle effa9f6
Add board config for T480
akunterkontrolle 3a4be96
add a new t480.mk dealing with blobs
notgivenby 0be89cb
add dependencies and a script to download and modify essential blobs …
notgivenby 277e4da
change gbe and ifd_16 files
notgivenby fd3745c
modules/coreboot: t480; do not reuse 24.02.01 coreboot buildtack, sin…
tlaurion 820931b
Revert "modules/coreboot: t480; do not reuse 24.02.01 coreboot buildt…
tlaurion 304f6b9
blobs/t480/download-clean-deguard-me.sh: deguard local call needs pyt…
tlaurion 5ce5705
boards/t480-maximized/t480-maximized.config: use t480 target that cal…
tlaurion c44285c
config/linux-t480.config: use config/linux-librem_common-6.1.8.config…
tlaurion de0a1f4
config/coreboot-t480.config: adapt from config/coreboot-librem_15v4.c…
tlaurion bdb09c6
bin/fetch_coreboot_crossgcc_archive.sh: change acpica default PFG_BAS…
tlaurion 6176f6c
modules/coreboot: t480; state its based on 24.12, do not reuse corebo…
tlaurion 44b4d6a
config/coreboot-t480.config: change Dsp_*.fd paths to non-existing fi…
tlaurion 4310d89
CircleCI: add t480 without reusing any other cache then muslc-cross-m…
tlaurion d666b81
config/coreboot-t480.config: Set CONFIG_FSP_FULL_FD=y so that vendorf…
tlaurion 7f673d4
patches/coreboot-t480/85278-post-skylake-pr0.patch: add unmerged upst…
tlaurion 32fc31b
patches/coreboot-t480/85278-post-skylake-pr0.patch: remove xeon bits …
tlaurion e62b84b
config/coreboot-t480.config: add PR0, unify against nv41, save in old…
tlaurion 002d107
config/coreboot-t480.config: unset CONFIG_DISPLAY_FSP_VERSION_INFO ot…
tlaurion e8974da
boards/t480-maximized/t480-maximized.config: enable pr0 (impacts only…
tlaurion f75ddb8
add t480 board
gaspar-ilom f9ba787
config/coreboot-t480.config: set CONFIG_FSP_USE_REPO=y otherwise buil…
tlaurion fd55341
fix t480p-hotp-maximized -> t480-hotp-maximized; unify against x230; …
tlaurion e6d6001
Merge remote-tracking branch 'gaspar-ilom/t480' into poc_t480
tlaurion ae595f2
t480: remove blobs/t480 prior work of @notgivenby since we rely on si…
tlaurion 8149c30
t480-maximized -> t480: we are not neutering ME anymore, therefore th…
tlaurion aff8e13
targets/t480_me_blobs.mk: remove leftover artifact of @notgivenby fro…
tlaurion cfeb1e3
CircleCI: build workspace cache when building t480-hotp so t480 can r…
tlaurion 296e7be
try fixing tpm config for t480
gaspar-ilom 1391bf9
t480 board configs: revew vs nv41, unify between each other and enabl…
tlaurion 073d244
remove resolved todo as config is now confirmed
gaspar-ilom 5a50de6
set the mac address to 00:de:ad:c0:ff:ee in the gbe.bin blob for the …
gaspar-ilom b2637ce
t480 boards and coreboot config: rename to maximized since ifd reuses…
tlaurion 796a6c3
t480: remove unneeded patches from libreboot under patches/coreboot-2…
tlaurion 0d53e8a
rename coreboot-2412 to coreboot-24.12 for versioning consistency, mo…
tlaurion 82cc410
t480 board configs: add notes that MAC is forged in GBE provided in t…
tlaurion acd6c85
fix mac address in t480 config comments
gaspar-ilom 447754e
fix whitespace/formatting of download_clean_deguard_me.sh
gaspar-ilom 930b977
fix gbe.bin hash for t480
gaspar-ilom 820c38c
fix t480 board config comments
gaspar-ilom f02ab49
System Info (battery info): dependant functions: add tracing and debug
tlaurion 9978aa6
add some warning to the t480 board config about the TPM GPIO reset at…
gaspar-ilom 384e243
TESTING: CircleCI: force AVAILABLE_MEM_GB=8 so that we respect guaran…
tlaurion 67a027d
CircleCI: add coreboot 24.12 in save_cache/restore_cache statements i…
tlaurion 84c0b2d
CircleCI: drop building d16 which causes build issues with changes to…
tlaurion 0416162
add more volunteers as board testers for the T480
gaspar-ilom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
me.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
The ME blobs dumped in this directory come from the following link: https://dl.dell.com/FOLDER04573471M/1/Inspiron_5468_1.3.0.exe | ||
|
||
This provides ME version 11.6.0.1126. In this version CVE-2017-5705 has not yet been fixed. | ||
See https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00086.html | ||
Therefore, Bootguard can be disabled by deguard with a patched ME. | ||
|
||
1.0.0:Automatically extract, neuter and deguard me.bin | ||
download_clean_me.sh : Downloads vulnerable ME from Dell verify checksum, extract ME, neuters ME, relocate and trim it, then apply deguard patch and place it into me.bin | ||
|
||
sha256sum: | ||
1990b42df67ba70292f4f6e2660efb909917452dcb9bd4b65ea2f86402cfa16b me.bin | ||
|
||
1.0.1: Extract blobs from original rom: | ||
extract.sh: takes backup, unlocks ifd, apply me_cleaner to neuter, relocate, trim and deguard it, modify BIOS and ME region of IFD and place output files into this dir. | ||
|
||
sha256sum: will vary depending of IFD and ME extracted where IFD regions of BIOS and ME should be consistent. | ||
|
||
1.1: More blobs | ||
-------------------- | ||
ifd.bin was extracted from a T480 from an external flashrom backup. | ||
|
||
sha256sum: | ||
f2f6d5fb0a5e02964b494862032fd93f1f88e2febd9904b936083600645c7fdf ifd.bin | ||
|
||
sha256sum: | ||
6b7f3912995fb87ae62956e009470b35b72b5b9a4bfd7bed48da429af9804866 gbe.bin | ||
tlaurion marked this conversation as resolved.
Show resolved
Hide resolved
|
||
------------------------ | ||
|
||
Notes: as specified in first link, this ME can be deployed to: | ||
T480 and T480s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
#!/usr/bin/env bash | ||
|
||
# These variables are all for the deguard tool. | ||
# They would need to be changed if using the tool for other devices like the T480s or with a different ME version... | ||
ME_delta="thinkpad_t480" | ||
ME_version="11.6.0.1126" | ||
ME_sku="2M" | ||
ME_pch="LP" | ||
|
||
# Integrity checks for the vendor provided ME blob... | ||
ME_DOWNLOAD_HASH="ddfbc51430699e0dfcb24a60bcb5b6e5481b325ebecf1ac177e069013189e4b0" | ||
# ...and the cleaned and deguarded version from that blob. | ||
DEGUARDED_ME_BIN_HASH="1990b42df67ba70292f4f6e2660efb909917452dcb9bd4b65ea2f86402cfa16b" | ||
|
||
function usage() { | ||
echo -n \ | ||
"Usage: $(basename "$0") path_to_output_directory | ||
Download Intel ME firmware from Dell, neutralize and shrink keeping the MFS. | ||
" | ||
} | ||
|
||
function chk_sha256sum() { | ||
sha256_hash="$1" | ||
filename="$2" | ||
echo "$sha256_hash" "$filename" "$(pwd)" | ||
sha256sum "$filename" | ||
if ! echo "${sha256_hash} ${filename}" | sha256sum --check; then | ||
echo "ERROR: SHA256 checksum for ${filename} doesn't match." | ||
exit 1 | ||
fi | ||
} | ||
|
||
function chk_exists() { | ||
if [ -e "$me_deguarded" ]; then | ||
echo "me.bin already exists" | ||
if echo "${DEGUARDED_ME_BIN_HASH} $me_deguarded" | sha256sum --check; then | ||
echo "SKIPPING: SHA256 checksum for me.bin matches." | ||
exit 0 | ||
fi | ||
retry="y" | ||
echo "me.bin exists but checksum doesn't match. Continuing..." | ||
fi | ||
} | ||
|
||
function download_and_clean() { | ||
me_output="$(realpath "${1}")" | ||
|
||
# Download and unpack the Dell installer into a temporary directory and | ||
# extract the deguardable Intel ME blob. | ||
pushd "$(mktemp -d)" || exit | ||
|
||
# Download the installer that contains the ME blob | ||
me_installer_filename="Inspiron_5468_1.3.0.exe" | ||
user_agent="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" | ||
curl -A "$user_agent" -s -O "https://dl.dell.com/FOLDER04573471M/1/${me_installer_filename}" | ||
chk_sha256sum "$ME_DOWNLOAD_HASH" "$me_installer_filename" | ||
|
||
# Download the tool to unpack Dell's installer and unpack the ME blob. | ||
git clone https://github.com/platomav/BIOSUtilities | ||
git -C BIOSUtilities checkout ef50b75ae115ae8162fa8b0a7b8c42b1d2db894b | ||
|
||
python "BIOSUtilities/Dell_PFS_Extract.py" "${me_installer_filename}" -e || exit | ||
|
||
extracted_me_filename="1 Inspiron_5468_1.3.0 -- 3 Intel Management Engine (Non-VPro) Update v${ME_version}.bin" | ||
|
||
mv "${me_installer_filename}_extracted/Firmware/${extracted_me_filename}" "${COREBOOT_DIR}/util/me_cleaner" | ||
rm -rf ./* | ||
popd || exit | ||
|
||
# Neutralize and shrink Intel ME. Note that this doesn't include | ||
# --soft-disable to set the "ME Disable" or "ME Disable B" (e.g., | ||
# High Assurance Program) bits, as they are defined within the Flash | ||
# Descriptor. | ||
# However, the HAP bit must be enabled to make the deguarded ME work. We only clean the ME in this function. | ||
# https://github.com/corna/me_cleaner/wiki/External-flashing#neutralize-and-shrink-intel-me-useful-only-for-coreboot | ||
pushd "${COREBOOT_DIR}/util/me_cleaner" || exit | ||
|
||
# MFS is needed for deguard so we whitelist it here and also do not relocate the FTPR partition | ||
python me_cleaner.py --whitelist MFS -t -O "$me_output" "$extracted_me_filename" | ||
rm -f "$extracted_me_filename" | ||
popd || exit | ||
} | ||
|
||
function deguard() { | ||
me_input="$(realpath "${1}")" | ||
me_output="$(realpath "${2}")" | ||
|
||
# Download the deguard tool into a temporary directory and apply the patch to the cleaned ME blob. | ||
pushd "$(mktemp -d)" || exit | ||
git clone https://review.coreboot.org/deguard.git | ||
pushd deguard || exit | ||
git checkout 0ed3e4ff824fc42f71ee22907d0594ded38ba7b2 | ||
|
||
python ./finalimage.py \ | ||
--delta "data/delta/$ME_delta" \ | ||
--version "$ME_version" \ | ||
--pch "$ME_pch" \ | ||
--sku "$ME_sku" \ | ||
--fake-fpfs data/fpfs/zero \ | ||
--input "$me_input" \ | ||
--output "$me_output" | ||
|
||
popd || exit | ||
#Cleanup | ||
rm -rf ./* | ||
popd || exit | ||
} | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then | ||
if [[ "${1:-}" == "--help" ]]; then | ||
usage | ||
else | ||
|
||
output_dir="$(realpath "${1:-./}")" | ||
me_cleaned="${output_dir}/me_cleaned.bin" | ||
me_deguarded="${output_dir}/me.bin" | ||
chk_exists | ||
|
||
if [[ -z "${COREBOOT_DIR}" ]]; then | ||
echo "ERROR: No COREBOOT_DIR variable defined." | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -f "$me_deguarded" ]] || [ "$retry" = "y" ]; then | ||
download_and_clean "$me_cleaned" | ||
deguard "$me_cleaned" "$me_deguarded" | ||
rm -f "$me_cleaned" | ||
fi | ||
|
||
chk_sha256sum "$DEGUARDED_ME_BIN_HASH" "$me_deguarded" | ||
fi | ||
fi |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
d3af2dfbf128bcddfc8c5810a11478697312e5701668f719f80f3f6322db5642 gbe.bin | ||
f2f6d5fb0a5e02964b494862032fd93f1f88e2febd9904b936083600645c7fdf ifd.bin | ||
1990b42df67ba70292f4f6e2660efb909917452dcb9bd4b65ea2f86402cfa16b me.bin | ||
This comment was marked as resolved.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Someone not trusting git could do a sha256sum -c against that file in the blobs dir.
This comment was marked as resolved.
Sorry, something went wrong. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Configuration for a T480 running Qubes 4.2.3 and other Linux Based OSes (through kexec) | ||
# | ||
# CAVEATS: | ||
# This board is vulnerable to a TPM reset attack, i.e. the PCRs are reset while the system is running. | ||
# This attack can be used to bypass measured boot when an attacker succeeds at modifying the SPI flash. | ||
# Also it can be used to extract FDE keys from a TPM. | ||
# The related coreboot issue contains more information: https://ticket.coreboot.org/issues/576 | ||
# Make sure you understand the implications of the attack for your threat model before using this board. | ||
# | ||
# Includes | ||
# - Deactivated+neutered+deguarded ME and expanded consequent IFD BIOS regions | ||
# - Forged GBE MAC address to 00:DE:AD:C0:FF:EE MAC address (if not extracting gbe.bin from backup with blobs/xx80/extract.sh) | ||
# - Note that this MAC address can be modified under build/coreboot-VER/util/bincfg/gbe-82579LM.set | ||
# | ||
# - Includes Nitrokey/Librem Key HOTP Security dongle remote attestation (in addition to TOTP remote attestation through Qr Code) | ||
|
||
export CONFIG_COREBOOT=y | ||
export CONFIG_COREBOOT_VERSION=24.12 | ||
export CONFIG_LINUX_VERSION=6.1.8 | ||
|
||
CONFIG_COREBOOT_CONFIG=config/coreboot-t480-maximized.config | ||
# TODO: Make a ThinkPad-common Linux config file. | ||
CONFIG_LINUX_CONFIG=config/linux-t480.config | ||
|
||
#On-demand hardware support (modules.cpio) | ||
CONFIG_LINUX_USB=y | ||
CONFIG_LINUX_E1000E=y | ||
CONFIG_MOBILE_TETHERING=y | ||
|
||
#Modules packed into tools.cpio | ||
CONFIG_CRYPTSETUP2=y | ||
CONFIG_FLASHPROG=y | ||
CONFIG_FLASHTOOLS=y | ||
CONFIG_GPG2=y | ||
CONFIG_KEXEC=y | ||
CONFIG_UTIL_LINUX=y | ||
CONFIG_LVM2=y | ||
CONFIG_MBEDTLS=y | ||
CONFIG_PCIUTILS=y | ||
|
||
#platform locking finalization (PR0) | ||
CONFIG_IO386=y | ||
export CONFIG_FINALIZE_PLATFORM_LOCKING=y | ||
|
||
|
||
#Remote attestation support | ||
# TPM2 requirements | ||
CONFIG_TPM2_TSS=y | ||
CONFIG_OPENSSL=y | ||
#Remote Attestation common tools | ||
CONFIG_POPT=y | ||
CONFIG_QRENCODE=y | ||
CONFIG_TPMTOTP=y | ||
#HOTP based remote attestation for supported USB Security dongle | ||
#With/Without TPM support | ||
CONFIG_HOTPKEY=y | ||
#Nitrokey Storage admin tool (deprecated) | ||
#CONFIG_NKSTORECLI=n | ||
|
||
#GUI Support | ||
#Console based Whiptail support(Console based, no FB): | ||
#CONFIG_SLANG=y | ||
#CONFIG_NEWT=y | ||
#FBWhiptail based (Graphical): | ||
CONFIG_CAIRO=y | ||
CONFIG_FBWHIPTAIL=y | ||
|
||
#Additional tools (tools.cpio): | ||
#SSH server (requires ethernet drivers, eg: CONFIG_LINUX_E1000E) | ||
CONFIG_DROPBEAR=y | ||
|
||
#Runtime configuration | ||
#Automatically boot if HOTP is valid | ||
export CONFIG_AUTO_BOOT_TIMEOUT=5 | ||
#TPM2 requirements | ||
export CONFIG_TPM2_TOOLS=y | ||
export CONFIG_PRIMARY_KEY_TYPE=ecc | ||
#TPM1 requirements | ||
#export CONFIG_TPM=y | ||
#Enable DEBUG output, debug output probably a good idea for first tests TODO:remove prior of merge | ||
export CONFIG_DEBUG_OUTPUT=y | ||
export CONFIG_ENABLE_FUNCTION_TRACING_OUTPUT=y | ||
#Enable TPM2 pcap output under /tmp | ||
export CONFIG_TPM2_CAPTURE_PCAP=n | ||
#Enable quiet mode: technical information logged under /tmp/debug.log, not quiet for first test | ||
export CONFIG_QUIET_MODE=n | ||
export CONFIG_BOOTSCRIPT=/bin/gui-init | ||
export CONFIG_BOOT_REQ_HASH=n | ||
export CONFIG_BOOT_REQ_ROLLBACK=n | ||
export CONFIG_BOOT_KERNEL_ADD="" | ||
export CONFIG_BOOT_KERNEL_REMOVE="intel_iommu=on intel_iommu=igfx_off" | ||
export CONFIG_BOARD_NAME="Thinkpad T480-hotp-maximized" | ||
export CONFIG_FLASH_OPTIONS="flashprog --progress --programmer internal" | ||
|
||
#Include bits related to ivybridge ME blob download/neutering down to BUP+ROMP | ||
BOARD_TARGETS := xx80_me_blobs |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
Sorry, something went wrong.