Model, firmware and version:
Laptop manufacturer: Lenovo
Laptop type: ThinkPad X1 Carbon, 3rd gen., 20BTS08N00
FW manufacturer: Phoenix
FW type: SecureCore for ThinkPad
FW version: 1.34, N14ET56W, 2021-08-31 (latest available version)
Basically, I want to follow the following steps:
- Create my own PK, KEK(s) and DBK(s)
- Sign refind.efi (my boot manager), kernels and kernel modules
- Extract the original OEM keys from the laptop firmware
- Merge the extracted OEM keys and my own keys into a combined key list
- Install the combined key list into the NVRAM
The laptop firmware supports three settings with two options each.
- "Secure Boot" can be enabled or disabled.
If Secure Boot is disabled, the EFI variables PK, KEK, db and dbx are not available at all. So Secure Boot must be enabled. - "Platform Mode" can be "Setup Mode" or "User Mode"
If the Platform Mode is in Setup Mode, the EFI variables PK, KEK, db and dbx are writable and signature verification is not enforced. In that mode, the FW also allows to boot an unsigned EFI binary. In "User Mode", the EFI variables PK, KEK, db and dbx are read-only. Signature verification is enforced. - "Secure Boot Mode" can be "Standard Mode" or "Custom Mode"
This setting is rather implicit. "Standard Mode" means that the default key lists are in place. "Custom Mode" means that the key lists are not the default lists which are shipped with the firmware.
- Restore Factory Keys
This action puts the Platform Mode into User Mode, but also restores the default lists for PK, KEK, db and dbx. After that signature verification is enforced, but also any custom signature key is lost. - Reset to Setup Mode
This action puts the Platform Mode into Setup Mode, but also erases the lists PK, KEK, db and dbx. After that signature verification is disabled, but there is also no key left (even the OEMs keys are erased). - Clear All Secure Boot Keys
Seems to have the same effect as "Reset To Setup Mode".
Now for the problem in step #5. This is actually the more severe problem. After I had put the Platform Mode into "Setup Mode" I was able to install my own key lists into the empty EFI variables. Now, I somehow need to switch the Platform mode back into "User Mode". Initially, I expected that to happen automatically upon the next boot, when the UEFI firmware recognizes that the key lists are not empty anymore. However, the FW remains in "Setup Mode" and signature verification remains disabled. (I was able to verify that by booting an unsigned EFI binary). The only way to switch back to "User Mode" seems to be via the action "Restore Factory Keys". However, this overwrites my custom key lists with the default ones. (I was able to verify that because I was only able to boot Windows, everything else failed with a "signature violation" from the FW). At this point I am lost in a dead-end. It looks like a vicious circle. This leads to my question: How do I install my custom key lists in Setup Mode and then switch back to User Mode in order to enforce signature verification without loosing my custom key lists?
In case it helps:
Code: Select all
ThinkPad Setup
Security
┌─────────────────────────────────────────────────────┬────────────────────────┐
│ Secure Boot │ Item Specific Help │
├─────────────────────────────────────────────────────┼────────────────────────┤
│ │ │
│ Secure Boot [Enabled] │ This option is used │
│ │ to restore all keys │
│ Platform Mode User Mode │ and certificates in │
│ Secure Boot Mode Standard Mode │ Secure Boot databases │
│ │ for factory defaults. │
│ Reset to Setup Mode [Enter] │ Any customized Secure │
│ Restore Factory Keys [Enter] │ Boot settings will be │
│ Clear All Secure Boot Keys [Enter] │ erased, and the │
│ │ default Platform Key │
│ │ will be │
│ │ re-established along │
│ │ with the original │
│ │ signature databases │
│ │ including certificate │
│ │ for Microsoft (R) │
│ │ Windows 8 (R). │
└─────────────────────────────────────────────────────┴────────────────────────┘
F1 Help ↑↓ Select Item +/- Change Values F9 Setup Defaults
Esc Exit ←→ Select Menu Enter Select ▶ Sub-Menu F10 Save and ExitCode: Select all
ThinkPad Setup
Security
┌─────────────────────────────────────────────────────┬────────────────────────┐
│ Secure Boot │ Item Specific Help │
├─────────────────────────────────────────────────────┼────────────────────────┤
│ │ │
│ Secure Boot [Enabled] │ This option is used │
│ │ to clear the current │
│ Platform Mode Setup Mode │ Platform Key and put │
│ Secure Boot Mode Custom Mode │ the system into setup │
│ │ mode. You can install │
│ Reset to Setup Mode [Enter] │ your own Platform Key │
│ Restore Factory Keys [Enter] │ and customize the │
│ Clear All Secure Boot Keys [Enter] │ Secure Boot │
│ │ signature databases │
│ │ in setup mode. │
│ │ │
│ │ Secure Boot mode │
│ │ will be set to custom │
│ │ mode. │
│ │ │
│ │ │
└─────────────────────────────────────────────────────┴────────────────────────┘
F1 Help ↑↓ Select Item +/- Change Values F9 Setup Defaults
Esc Exit ←→ Select Menu Enter Select ▶ Sub-Menu F10 Save and Exit



