Debian Codegraph @

src/security/vboot/Kconfig

raw
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 menu "Verified Boot (vboot)"
4
5 config VBOOT_LIB
6 bool
7 help
8 Build and link the vboot library. Makes the vboot API accessible across
9 all coreboot stages, without enabling vboot verification. For verification,
10 please see the VBOOT option below.
11
12 config VBOOT
13 bool "Verify firmware with vboot."
14 default n
15 select VBOOT_LIB
16 select VBOOT_MOCK_SECDATA if !TPM
17 depends on 0 = 0 # Must have a 'depends on' or board overrides will break it.
18 help
19 Enabling VBOOT will use vboot to verify the components of the firmware
20 (stages, payload, etc).
21
22 if VBOOT
23
24 comment "Anti-Rollback Protection disabled because mocking secdata is enabled."
25 depends on VBOOT_MOCK_SECDATA
26
27 config VBOOT_SLOTS_RW_A
28 bool "Firmware RO + RW_A"
29 help
30 Have one update partition beside the RO partition.
31
32 config VBOOT_SLOTS_RW_AB
33 bool "Firmware RO + RW_A + RW_B"
34 select VBOOT_SLOTS_RW_A
35 help
36 Have two update partitions beside the RO partition.
37
38 config VBOOT_CBFS_INTEGRATION
39 bool "Enable vboot and CBFS integration"
40 default n
41 depends on VBOOT_SLOTS_RW_A
42 depends on CBFS_VERIFICATION
43 select INCLUDE_CONFIG_FILE # futility needs this to auto-detect signing type
44 help
45 Say yes here to enable cryptographic verification of RW slots CBFS
46 metadata. This will replace body hash verification.
47
48 This option enables integration of vboot and CBFS. Verification of RW
49 slots is performed by calculation of their CBFS metadata hash.
50 It also requires CBFS_VERIFICATION to be enabled, so that CBFS files
51 contents are correctly verified.
52
53 config VBOOT_VBNV_CMOS
54 bool
55 default n
56 depends on PC80_SYSTEM
57 help
58 VBNV is stored in CMOS
59
60 config VBOOT_VBNV_OFFSET
61 hex
62 default 0x26
63 depends on VBOOT_VBNV_CMOS
64 help
65 CMOS offset for VbNv data. This value must match cmos.layout
66 in the mainboard directory, minus 14 bytes for the RTC.
67
68 config VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
69 bool
70 default n
71 depends on VBOOT_VBNV_CMOS && BOOT_DEVICE_SUPPORTS_WRITES
72 help
73 Vboot non-volatile storage data will be backed up from CMOS to flash
74 and restored from flash if the CMOS is invalid due to power loss.
75
76 config VBOOT_VBNV_FLASH
77 bool
78 default n
79 depends on BOOT_DEVICE_SUPPORTS_WRITES
80 help
81 VBNV is stored in flash storage
82
83 config VBOOT_STARTS_BEFORE_BOOTBLOCK
84 def_bool n
85 select VBOOT_SEPARATE_VERSTAGE
86 help
87 Firmware verification happens before the main processor is brought
88 online.
89
90 config VBOOT_STARTS_IN_BOOTBLOCK
91 bool
92 default n
93 select SEPARATE_ROMSTAGE
94 help
95 Firmware verification happens during the end of or right after the
96 bootblock. This implies that a static VBOOT2_WORK() buffer must be
97 allocated in memlayout.
98
99 config VBOOT_STARTS_IN_ROMSTAGE
100 bool
101 default n
102 depends on !VBOOT_STARTS_IN_BOOTBLOCK
103 help
104 Firmware verification happens during the end of romstage (after
105 memory initialization). This implies that the vboot work buffer is
106 in CBMEM from the start and doesn't need to be reserved in memlayout.
107
108 config VBOOT_MOCK_SECDATA
109 bool "Mock secdata for firmware verification"
110 default n
111 help
112 Enabling VBOOT_MOCK_SECDATA will mock secdata for the firmware
113 verification to avoid access to a secdata storage (typically TPM).
114 All operations for a secdata storage will be successful. This option
115 can be used during development when a TPM is not present or broken.
116 THIS SHOULD NOT BE LEFT ON FOR PRODUCTION DEVICES.
117
118 config VBOOT_DISABLE_DEV_ON_RECOVERY
119 bool
120 default n
121 help
122 When this option is enabled, the ChromeOS device leaves the
123 developer mode as soon as recovery request is detected. This is
124 handy on embedded devices with limited input capabilities.
125
126 config VBOOT_SEPARATE_VERSTAGE
127 bool
128 default n
129 depends on VBOOT_STARTS_IN_BOOTBLOCK || VBOOT_STARTS_BEFORE_BOOTBLOCK
130 help
131 If this option is set, vboot verification runs in a standalone stage
132 that is loaded from the bootblock and exits into romstage. If it is
133 not set, the verification code is linked directly into the bootblock
134 or the romstage and runs as part of that stage (cf. related options
135 VBOOT_STARTS_IN_BOOTBLOCK/_ROMSTAGE and VBOOT_RETURN_FROM_VERSTAGE).
136
137 config VBOOT_RETURN_FROM_VERSTAGE
138 bool
139 default n
140 depends on VBOOT_SEPARATE_VERSTAGE
141 help
142 If this is set, the verstage returns back to the calling stage instead
143 of exiting to the succeeding stage so that the verstage space can be
144 reused by the succeeding stage. This is useful if a RAM space is too
145 small to fit both the verstage and the succeeding stage.
146
147 config VBOOT_MUST_REQUEST_DISPLAY
148 bool
149 default y if VGA_ROM_RUN
150 default n
151 help
152 Set this option to indicate to vboot that this platform will skip its
153 display initialization on a normal (non-recovery, non-developer) boot.
154 Unless display is specifically requested, the video option ROM is not
155 loaded, and any other native display initialization code is not run.
156
157 config VBOOT_ALWAYS_ENABLE_DISPLAY
158 bool "Force to always enable display"
159 default y if BMP_LOGO
160 default n
161 help
162 Set this option to indicate to vboot that display should always be enabled.
163
164 config VBOOT_ALWAYS_ALLOW_UDC
165 bool "Always allow UDC"
166 default n
167 depends on !CHROMEOS
168 help
169 This option allows UDC to be enabled regardless of the vboot state.
170
171 config VBOOT_HAS_REC_HASH_SPACE
172 bool
173 default y if MRC_SAVE_HASH_IN_TPM && HAS_RECOVERY_MRC_CACHE
174 default n
175 help
176 Set this option to indicate to vboot that recovery data hash space
177 is present in TPM.
178
179 config VBOOT_LID_SWITCH
180 bool
181 default n
182 help
183 Whether this platform has a lid switch. If it does, vboot will not
184 decrement try counters for boot failures if the lid is closed.
185
186 config VBOOT_WIPEOUT_SUPPORTED
187 bool
188 default n
189 help
190 When this option is enabled, the firmware provides the ability to
191 signal the application the need for factory reset (a.k.a. wipe
192 out) of the device
193
194 config VBOOT_FWID_MODEL
195 string "Firmware ID model"
196 default "Google_\$(CONFIG_MAINBOARD_PART_NUMBER)" if CHROMEOS
197 default "\$(CONFIG_MAINBOARD_VENDOR)_\$(CONFIG_MAINBOARD_PART_NUMBER)"
198 help
199 This is the first part of the FWID written to various regions of a
200 vboot firmware image to identify its version.
201
202 config VBOOT_FWID_VERSION
203 string "Firmware ID version"
204 default ".\$(KERNELVERSION)"
205 help
206 This is the second part of the FWID written to various regions of a
207 vboot firmware image to identify its version.
208
209 config VBOOT_NO_BOARD_SUPPORT
210 bool "Allow the use of vboot without board support"
211 default n
212 help
213 Enable weak functions for get_write_protect_state and
214 get_recovery_mode_switch in order to proceed with refactoring
215 of the vboot2 code base. Later on this code is removed and replaced
216 by interfaces.
217
218 config RO_REGION_ONLY
219 string "Additional files that should not be copied to RW"
220 default ""
221 help
222 Add a space delimited list of filenames that should only be in the
223 RO section.
224
225 config RW_REGION_ONLY
226 string
227 default ""
228 depends on VBOOT_SLOTS_RW_A
229 help
230 Add a space delimited list of filenames that should only be in the
231 RW sections.
232
233 config RWA_REGION_ONLY
234 string
235 default ""
236 depends on VBOOT_SLOTS_RW_AB
237 help
238 Add a space-delimited list of filenames that should only be in the
239 RW-A section.
240
241 config RWB_REGION_ONLY
242 string
243 default ""
244 depends on VBOOT_SLOTS_RW_AB
245 help
246 Add a space-delimited list of filenames that should only be in the
247 RW-B section.
248
249 config CBFS_MCACHE_RW_PERCENTAGE
250 int "Percentage of CBFS metadata cache used for RW CBFS"
251 depends on !NO_CBFS_MCACHE
252 default 50
253 help
254 The amount of the CBFS_MCACHE area that's used for the RW CBFS, in
255 percent from 0 to 100. The remaining area will be used for the RO
256 CBFS. Default is an even 50/50 split. When VBOOT is disabled, this
257 will automatically be 0 (meaning the whole MCACHE is used for RO).
258 Do NOT change this value for vboot RW updates!
259
260 config VBOOT_CLEAR_RECOVERY_IN_RAMSTAGE
261 bool "Clear the recovery request at the end of ramstage"
262 default n
263 help
264 If this option is enabled, the recovery request will be cleared and
265 saved to VBNV storage at the end of ramstage. This is useful for
266 platforms without vboot-integrated payloads, to avoid being stuck in
267 the recovery mode.
268
269 config VBOOT_ENABLE_CBFS_FALLBACK
270 bool
271 default n
272 depends on VBOOT_SLOTS_RW_A
273 help
274 When this option is enabled, the CBFS code will look for a file in the
275 RO (COREBOOT) region if it isn't available in the active RW region.
276
277 config VBOOT_EARLY_EC_SYNC
278 bool
279 default n
280 depends on EC_GOOGLE_CHROMEEC
281 help
282 Enables CrOS EC software sync in romstage, before memory training
283 runs. This is useful mainly as a way to achieve full USB-PD
284 negotiation earlier in the boot flow, as the EC will only do this once
285 it has made the sysjump to its RW firmware. It should not
286 significantly impact boot time, as this operation will be performed
287 later in the boot flow if it is disabled here.
288
289 config VBOOT_EC_SYNC_ESOL
290 bool
291 default n
292 depends on VBOOT_EARLY_EC_SYNC && CHROMEOS_ENABLE_ESOL
293 help
294 Enables the display of early sign-of-life (eSOL) when the EC is slow
295 to update its firmware to inform the user that the update is happening.
296
297 config VBOOT_EC_EFS
298 bool "Early firmware selection (EFS) EC"
299 default n
300 help
301 CrosEC can support EFS: Early Firmware Selection. If it's enabled,
302 software sync needs to also support it. This setting tells vboot to
303 perform EFS software sync.
304
305 config VBOOT_X86_SHA256_ACCELERATION
306 bool "Use sha extension for sha256 hash calculation"
307 default n
308 depends on ARCH_X86
309 help
310 Use sha256msg1, sha256msg2, sha256rnds2 instruction to accelerate
311 SHA hash calculation in vboot.
312
313 config VBOOT_X86_RSA_ACCELERATION
314 bool "Use SSE2 instructions for RSA signature verification"
315 default n
316 depends on ARCH_X86
317 help
318 Use paddq, pmuludq, psrlq, punpckldq and punpcklqdq SSE2
319 instructions to accelerate the modulus exponentiation which
320 is part of the RSA signature verification process.
321
322 config VBOOT_ARMV8_CE_SHA256_ACCELERATION
323 bool "Use ARMv8 Crypto Extension for sha256 hash calculation"
324 default y if CHROMEOS
325 default n
326 depends on ARCH_ARM64
327 help
328 Use ARMv8 Crypto Extension to accelerate SHA hash calculation in vboot.
329
330 config VBOOT_ARM64_RSA_ACCELERATION
331 bool "Use arm64 SIMD instructions to accelerate RSA signature verification"
332 default y
333 depends on ARCH_VERSTAGE_ARM64
334 help
335 Use arm64 SIMD instructions (NEON) to parallelize two multiplications
336 in the modulus exponentiation algorithm, which speeds up RSA signature
337 verification in vboot. This is supported on all arm64 CPUs so you'd
338 generally always want this enabled, unless your SoC is overriding
339 vboot's hwcrypto API with its own crypto accelerator IP instead (or
340 you're trying really hard to save on code size).
341
342 config VBOOT_DEFINE_WIDEVINE_COUNTERS
343 bool
344 default n
345 help
346 Set up Widevine Secure Counters in TPM NVRAM by defining space. Enabling this
347 config will only define the counter space. Counters need to be incremented
348 separately before any read operation is performed on them.
349
350 config VBOOT_HASH_BLOCK_SIZE
351 hex
352 default 0x400
353 help
354 Set the default hash size. Generally 1k is reasonable, but in some
355 cases it may improve hashing speed to increase the size.
356
357 Note that this buffer is allocated in the stack. Although the
358 build should fail if the stack size is exceeded, it's something to
359 be aware of when changing the size.
360
361 config VBOOT_GSCVD
362 bool "Generate GSC verification data"
363 depends on TPM_GOOGLE
364 select CBFS_VERIFICATION
365 default n if TPM_GOOGLE_CR50
366 default y
367 help
368 Generate a Google Security Chip Verification Data (GSCVD) structure on the flash to
369 allow the GSC to verify the CBFS verification anchor. Used by default with Ti50 GSCs.
370 Requires an RO_GSCVD FMAP section.
371
372 config VBOOT_GSC_BOARD_ID
373 string
374 depends on VBOOT_GSCVD
375 default "ZZCR"
376 help
377 GSC board ID to be embedded in the GSCVD. Usually each specific mainboard variant
378 has its own. Google engineers can find these in the go/cros-dlm database ("Products").
379 The specific board IDs are filled in as part of the production signing process, so
380 this value is just a default and doesn't need to be set per-variant in coreboot.
381 (Note: This is a completely separate thing from coreboot's `board_id()` function.)
382
383 menu "GBB configuration"
384
385 config GBB_HWID
386 string "Hardware ID"
387 default ""
388 help
389 A hardware identifier for device. On ChromeOS this is used for auto
390 update and recovery, and will be generated when manufacturing by the
391 factory software, in a strictly defined format.
392 Leave empty to get a test-only ChromeOS HWID v2 string generated.
393
394 config GBB_BMPFV_FILE
395 string "Path to bmpfv image"
396 default ""
397
398 config GBB_FLAG_DEV_SCREEN_SHORT_DELAY
399 bool "Reduce dev screen delay"
400 default n
401
402 config GBB_FLAG_LOAD_OPTION_ROMS
403 bool "Load option ROMs"
404 default n
405
406 config GBB_FLAG_ENABLE_ALTERNATE_OS
407 bool "Allow booting a non-ChromeOS kernel if dev switch is on"
408 default n
409
410 config GBB_FLAG_FORCE_DEV_SWITCH_ON
411 bool "Force dev switch on"
412 default n
413
414 config GBB_FLAG_FORCE_DEV_BOOT_USB
415 bool "Allow booting from USB in dev mode even if dev_boot_usb=0"
416 default y
417
418 config GBB_FLAG_DISABLE_FW_ROLLBACK_CHECK
419 bool "Disable firmware rollback protection"
420 default y
421
422 config GBB_FLAG_ENTER_TRIGGERS_TONORM
423 bool "Return to normal boot with Enter"
424 default n
425
426 config GBB_FLAG_FORCE_DEV_BOOT_ALTFW
427 bool "Allow booting altfw in dev mode even if dev_boot_altfw=0"
428 default n
429
430 config GBB_FLAG_RUNNING_FAFT
431 bool "Running FAFT tests; used as a hint to disable other debug features"
432 default n
433
434 config GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
435 bool "Disable EC software sync"
436 default n
437
438 config GBB_FLAG_DEFAULT_DEV_BOOT_ALTFW
439 bool "Default to booting altfw in dev mode"
440 default n
441
442 config GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC
443 bool "Disable PD software sync"
444 default n
445
446 config GBB_FLAG_DISABLE_LID_SHUTDOWN
447 bool "Disable shutdown on closed lid"
448 default n
449
450 config GBB_FLAG_FORCE_MANUAL_RECOVERY
451 bool "Always assume manual recovery in recovery mode"
452 default n
453
454 config GBB_FLAG_DISABLE_FWMP
455 bool "Disable Firmware Management Parameters (FWMP)"
456 default n
457
458 config GBB_FLAG_ENABLE_UDC
459 bool "Enable USB Device Controller"
460 default n
461
462 config GBB_FLAG_FORCE_CSE_SYNC
463 bool "Running tests; enforce CSE sync"
464 default n
465
466 endmenu # GBB
467
468 menu "Vboot Keys"
469 config VBOOT_ROOT_KEY
470 string "Root key (public)"
471 default "\$(VBOOT_SOURCE)/tests/devkeys/root_key.vbpubk"
472
473 config VBOOT_RECOVERY_KEY
474 string "Recovery key (public)"
475 default "\$(VBOOT_SOURCE)/tests/devkeys/recovery_key.vbpubk"
476
477 config VBOOT_FIRMWARE_PRIVKEY
478 string "Firmware key (private)"
479 default "\$(VBOOT_SOURCE)/tests/devkeys/firmware_data_key.vbprivk"
480
481 config VBOOT_KERNEL_KEY
482 string "Kernel subkey (public)"
483 default "\$(VBOOT_SOURCE)/tests/devkeys/kernel_subkey.vbpubk"
484
485 config VBOOT_KEYBLOCK
486 string "Keyblock to use for the RW regions"
487 default "\$(VBOOT_SOURCE)/tests/devkeys/firmware.keyblock"
488
489 config VBOOT_KEYBLOCK_VERSION
490 int "Keyblock version number"
491 default 1
492
493 config VBOOT_KEYBLOCK_PREAMBLE_FLAGS
494 hex "Keyblock preamble flags"
495 default 0x0
496
497 if VBOOT_GSCVD
498
499 config VBOOT_GSCVD_ROOT_PUBKEY
500 string "GSCVD root key (public)"
501 default "\$(VBOOT_SOURCE)/tests/devkeys/arv_root.vbpubk"
502
503 config VBOOT_GSCVD_PLATFORM_PRIVKEY
504 string "GSCVD platform key (private)"
505 default "\$(VBOOT_SOURCE)/tests/devkeys/arv_platform.vbprivk"
506
507 config VBOOT_GSCVD_PLATFORM_KEYBLOCK
508 string "GSCVD platform keyblock (public)"
509 default "\$(VBOOT_SOURCE)/tests/devkeys/arv_platform.keyblock"
510
511 endif # VBOOT_GSCVD
512
513 endmenu # Keys
514 endif # VBOOT
515 endmenu # Verified Boot (vboot)