I’m working on implementing a secure boot environment on a Orin Nano and Orin NX, even tho I’m currently just testing on a Nano board.
To explain my setup first, I have the Nano with both an SD and NVMe as storage options. I’ve primarily flashed the SD card using the SDK manager, and the NVMe with using the l4t_flash_initrd.sh script. Both using the same Jetpack version (r36.4) and had no issues, but after I burn the SBK and Secure Boot Info I am unable to get a complete boot, instead it halts here:
��I/TC: Reserved shared memory is disabled
I/TC: Dynamic shared memory is enabled
I/TC: Normal World virtualization support is disabled
I/TC: Asynchronous notifications are disabled
E/TC:?? 00 jetson_user_key_pta_uefi_vars_auth:984 UEFI variable auth key not set !
E/TC:?? 00 stmm_handle_variable_authentication:894 Failed to get signed CMAC ffff0008
ASSERT [FvbNorFlashStandaloneMm] /out/nvidia/optee_ftpm.t234-uefi/StandaloneMmOptee_RELEASE/edk2-nvidia/Silicon/NVIDIA/Drivers/FvbNorFlashDxe/VarIntCheck.c(932): ((BOOLEAN)(0==1))
I’ve checked similar reports (with the same error) but they seem related to UEFI updates and they don’t seem to be related to my specific process. Even if I try to flash it again (including the SBK and hash as arguments) I can’t make it work since the flashing process stops due to a “USB timeout”.
let me double check the fuse variables, please share the fuse.xml you’re used for fuse burning. you may omit the key content for security concerns.
besides.. please execute flash script to have fuse read, let’s double check the fuse you’ve burnt onto this module. $ sudo ./flash.sh --read-info -u <pkc> -v <sbk> <target_conf> <rootdev>
I’ve some doubts about your flash commands, since it’s bootloader secure boot, you’ll need to flash QSPI which is belong to the internal rootfs device.
just an FYI,
here’re flash commands I used for image flashing onto SBKPKC fused Orin module. $ sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" -u rsa_priv-3k.pem -v sbk.key --showlogs --network usb0 jetson-orin-nano-devkit internal $ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only -u rsa_priv-3k.pem -v sbk.key jetson-agx-orin-devkit internal
FUSE_BOOT_SECURITY_INFO_0 is crucial fuse variable, it’s hardware for checking this to understand the secureboot authentication scheme.
please refer to Jetson Orin Fuse Specification.
let me re-cap as below..
FUSE_BOOT_SECURITY_INFO_0
Bits interpreted by boot software with following mapping:
Bits [2:0] mapped to Secure Boot Authentication Scheme,
where:
000b: SHA2-512 Hash (not recommended)
001b: 3072-bit RSA
010b: ECDSA P-256 Curve
011b: ECDSA P-521-Curve
100b: Ed25519
101b:XMSS – no Pre Hashing
Bit [3] secure boot encryption scheme (SBK) enable
...
hence..
you must program bit[2:0] according to your PKC key types,
you must enable bit[3] due to you’ve SBK keys fused onto your module.
please refer to Burn Fuses with the Fuse Configuration file.
let’s try burn the board again with additional fuse variable to resolve it.
please do bitwise logically OR with your BootSecurityInfo and 0x3E0.
for instance,
note,
you should omit PKC/SBK key to refuse this target since this target now recognize as non-secure borad.
i.e. $ sudo ./odmfuse.sh -X <fuse_config> -i 0x23 <target_config>
Thank you for the pointer, it does help a lot. I fused the Boot Security Info value again enabling both SBK and RSA 3K thus it changed as 3e0 → 3e9. After that, It behaves differently; now it asks me to include the PEM and SBK values when reading the fuses:
$ sudo ./flash.sh --read-info jetson-orin-nano-devkit external
###############################################################################
# L4T BSP Information:
# R36 , REVISION: 4.4
# User release: 0.0
###############################################################################
ECID is 0xA9012344705E020040000000110280C0
# Target Board Information:
# Name: jetson-orin-nano-devkit, Board Family: generic, SoC: Tegra 234,
# OpMode: production, Boot Authentication: SBKPKC,
# Disk encryption: disabled ,
###############################################################################
Error: Either RSA key file and/or SBK key file is not provided for SBK and PKC protected target board.
After I include them:
$ sudo ./flash.sh --read-info -u keys/oem_rsa_priv.pem -v keys/sbk.key jetson-orin-nano-devkit external
###############################################################################
# L4T BSP Information:
# R36 , REVISION: 4.4
# User release: 0.0
###############################################################################
ECID is 0xA9012344705E020040000000110280C0
# Target Board Information:
# Name: jetson-orin-nano-devkit, Board Family: generic, SoC: Tegra 234,
# OpMode: production, Boot Authentication: SBKPKC,
# Disk encryption: disabled ,
###############################################################################
copying device_config(/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/generic/BCT/tegra234-mb1-bct-device-p3767-0000.dts)... done.
copying misc_config(/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/generic/BCT/tegra234-mb1-bct-misc-p3767-0000.dts)... done.
copying emc_fuse_dev_params(/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/generic/BCT/tegra234-br-bct-diag-boot.dts)... done.
copying minratchet_config(/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/generic/BCT/tegra234-mb1-bct-ratchet-p3767-0000.dts)... done.
Existing emcfuse(/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/fuse_t234.xml) reused.
./tegraflash.py --chip "0x23" --applet "/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/mb1_t234_prod.bin" --skipuid --cfg readinfo_t234_min_prod.xml --dev_params tegra234-br-bct-diag-boot.dts --device_config tegra234-mb1-bct-device-p3767-0000.dts --misc_config tegra234-mb1-bct-misc-p3767-0000.dts --bins "mb2_applet applet_t234.bin" --key "/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/keys/oem_rsa_priv.pem" --encrypt_key "/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/keys/sbk.key" --minratchet_config tegra234-mb1-bct-ratchet-p3767-0000.dts --cmd "readfuses fuse_t234.bin fuse_t234.xml; dump eeprom cvm cvm.bin; dump try_custinfo custinfo_out.bin; reboot recovery"
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
[ 0.0118 ] Reading fuses
[ 0.0138 ] tegrasign_v3.py --key /home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/keys/oem_rsa_priv.pem --getmode mode.txt
[ 0.0172 ] Key size is 512 bytes
[ 0.0181 ] WARNING: Can't generate ECKey from EVPKey
[ 0.0191 ] ERROR: /home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/keys/oem_rsa_priv.pem key not match ED25519 key type
[ 0.0191 ] Warning: /home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/keys/oem_rsa_priv.pem is not valid ed25519 key in Open SSL format
[ 0.0191 ] Warning: Can not extract key from /home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/keys/oem_rsa_priv.pem
[ 0.0192 ] Invalid key format
[ 0.0192 ] ********* Error. Quitting. *********
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (2.2.3) or chardet (3.0.4) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
File "./tegraflash.py", line 1462, in <module>
tegraflash_run_commands()
File "./tegraflash.py", line 1279, in tegraflash_run_commands
interpreter.onecmd(command)
File "/usr/lib/python3.8/cmd.py", line 217, in onecmd
return func(arg)
File "./tegraflash.py", line 995, in do_readfuses
self.chip_inst.tegraflash_readfuses(exports, args)
File "/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py", line 2511, in tegraflash_readfuses
self.tegraflash_get_key_mode()
File "/home/drojas/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py", line 3535, in tegraflash_get_key_mode
with open('mode.txt') as mode_file:
FileNotFoundError: [Errno 2] No such file or directory: 'mode.txt'
Reading board information failed.
Additionally, I tried booting the board normally but I don’t see the fan moving and no serial log either.
I think that’s definitely a huge part of the issue. I verified and the key we were burning is a RSA 4K not 3K. Regardless, I tried on another board with a confirmed RSA 3k key. This are the fuses:
When it is done, the target reboots and stops at the same assert error:
��I/TC: Reserved shared memory is disabled
I/TC: Dynamic shared memory is enabled
I/TC: Normal World virtualization support is disabled
I/TC: Asynchronous notifications are disabled
E/TC:?? 00 jetson_user_key_pta_uefi_vars_auth:984 UEFI variable auth key not set !
E/TC:?? 00 stmm_handle_variable_authentication:894 Failed to get signed CMAC ffff0008
ASSERT [FvbNorFlashStandaloneMm] /out/nvidia/optee_ftpm.t234-uefi/StandaloneMmOptee_RELEASE/edk2-nvidia/Silicon/NVIDIA/Drivers/FvbNorFlashDxe/VarIntCheck.c(932): ((BOOLEAN)(0==1))
Initially both the Boot Info and PKC were incorrect, yet now that they are fixed the error persists.