Does secure boot work when booting from SD card on the Orin Nano Dev Kit?

Hi,
I enabled PKC secure boot (PKC-only, no SBK/OemK1) per the R36.4.3 guide. Fuses burned OK:

my .xml:

$ cat ../pkc/fuse_pkc.xml 
<genericfuse MagicId="0x45535546" version="1.0.0">
    <fuse name="PublicKeyHash" size="64" value="0xb9d3f....4bbdeba6c218"/>
    <fuse name="BootSecurityInfo" size="4" value="0x3E1"/>
    <fuse name="SecurityMode" size="4" value="0x1"/>
</genericfuse>

I then flashed PKC-signed firmware with both `flash.sh -u … mmcblk0p1` and `l4t_initrd_flash.sh -u …`, and both reported success.

The problem is the board is not completed cold-boot, the DisplayPort is black (“no signal”), no USB enumeration, no `/dev/ttyACM*`.

The device is getting to RCM and reflashing still works.

I fount these post where contributor says secure boot isn’t available on SD: Secure boot on jetson nano

I found also and old thread by Jerry Chang seems to say the same: SecureBoot on Jetson Nano, stuck at sign/flash the bootloader part

But the R36.4.3 Secure Boot guide says nothing about this: Secure Boot — NVIDIA Jetson Linux Developer Guide

Question: Is PKC secure boot supported on the Orin Nano Dev Kit booting from SD card, or only NVMe/external? If SD isn’t supported, is that documented for R36.x? If it is supported, what’s the correct setup for an SD-only board?

hello menahem,

let’s double check your current secureboot authentication scheme.
please read the fuse variables for confirmation.

see-also developer guide, Read Fuses through the Linux kernel, please execute nv_fuse_read.sh if you’re able to boot into linux.
or.. you may execute flash script via host machine, for instance, $ sudo ./flash.sh --read-info -u <pkc> -v <sbk> <target_conf> <rootdev>

Hi,
Thanks for the response.

First, I was not able to boot into linux, so I used ./flash.sh --read-info…, and it seems that the burning process completed successfully.

==== Fuse Info (/home/menahem/orin_security/Linux_for_Tegra/bootloader/fuse_t234.bin) ====
PublicKeyHash: b9d3f521923d94645dd491ea1d21290355bf6b7487a550c52405bc8fd4cd7f2dbd14dfc7cf27c3e5d09e3233ea2df61251c0ee5f73788c2317514bbdeba6c218
PkcPubkeyHash1: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
PkcPubkeyHash2: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
BootSecurityInfo: 000003e1
ArmJtagDisable: 00000000
SecurityMode: 00000001
SwReserved: 00000000
DebugAuthentication: 00000000
OdmInfo: 00000000
OdmId: 0000000000000000
OdmLock: 00000000
ReservedOdm0: 00000000
ReservedOdm1: 00000000
ReservedOdm2: 00000000
ReservedOdm3: 00000000
ReservedOdm4: 00000000
ReservedOdm5: 00000000
ReservedOdm6: 00000000
ReservedOdm7: 00000000
Sku: 000000d5
Uid: 808103070000002846f25d7004000000
OptEmcDisable: 0000000c

Later, I realized that the issue might have been caused by setting bit 9 in the BootSecurityInfo fuse without setting OemK1. The Secure Boot documentation states:

When the OemK1 fuse is burned, generate your own EKB signed and encrypted with keys derived from OemK1. Additionally, set your own UEFI variable authentication key in the EKB, called the auth key. Without the auth key, UEFI will fail to authenticate the UEFI variable and fail to boot.

When I added the auth key to the EKB, the device booted successfully.

However, even if the issue is not related to sd-card, I would still like to understand whether there are any restrictions on using sd-card with Secure Boot, as this is how we plan to use it in our product.

hello menahem,

all right, thanks for status update.

due to the root cause is auth key, that should related to a mismatch key for loading file system,
if that’s possible, please gather the UART logs for digging into the failure booting messages.

Just a quick update: I don’t have the debugger yet, but I’ve ordered one. Please keep this topic open. Thank you!

I enabled PKC secure boot (PKC-only, no SBK/OemK1)

<fuse name=“BootSecurityInfo” size=“4” value=“0x3E1”/>

The fuse value 3E1 corresponds to RSA 3K and OemK1. You’re correct that this has Secure Boot disabled. The correct BootSecurityInfo value for just RSA 3K would be 0x1E1.

The fuse value is the hexadecimal conversion from the binary-form setting options. The factory fuse value for later boards is 0x1E0, which in binary is 000111100000. From right to left, the first three [2:0] bits set the type of private key you’re using (RSA 3K, SHA, ECDSA, XMSS, etc), the next bit [3] enables SecureBoot, if it’s 1, disabled if 0. The next five bits [8:4] are reserved, which are usually 11110, the next bit [9] sets the valid ODM key, if it’s 1, you should be using an OemK1 key, if 0, you don’t need the OemK1 key.

So since you said you’re just setting the private key only, no SBK or OemK1, you’ll need the binary value to be 000111100001. Essentially, you’re only performing an OR operation on the first bit (0th place).

Factory - 000111100000
OR
Userset - 000000000001

Result - 000111100001b => 1E1h or 0x1E1.

Fuses burned OK

If you actually burned that BootSecurityInfo fuse value, you’ll need to either pass the default OemK1 key or burn your own OemK1 key to its respective fuse, or else you will not be able to successfully boot. The factory OemK1 fuse should be 00000000000000000000000000000000.

Thanks!

It seems you’re right. Two questions, if I may:

  1. Why does this prevent the device from booting? I would expect to see an error message, but the monitor remains black.
  2. Can I now also burn the OEM_K1 fuse? I’ve read in the Developer Guide that all fuses must be burned together.

I’m not sure how it would prevent at least trying to boot, but it would prevent the drive from being decrypted. With the OemK1 fuse burned, the device will look for the OemK1 key to decrypt the drive. I’m assuming you haven’t tried flashing an encrypted rootfs since your original post said you were only trying to burn the private key and not the SBK and OemK1, but since the BootSecurityInfo is flashed to expect a OemK1 encrypted file system.

You didn’t post the full commands you’re using to flash, but I would suggest trying to flash an encrypted file system with the factory OemK1. If that’s what you need to do, you’ll need to follow the OP-TEE documentation to produce the eks_t234.img with the default ekb and oemk1 key and use that when you create the rootfs image.

To use the factory keys, go to the folder with OP-TEE’s gen_ekb.py script, edit the example.sh file to remove the comment character (#) from the first half of the script, which are the echo commands to write 0s to the various key files. When you run it, you’ll get the eks_t234.img in the same directory. Copy that image to {BSP_TOP}/bootloader and copy the sym2_t234.key to {BSP_TOP}, which is the ekb key. When you make the rootfs image, use ROOTFS_ENC=1 and use the flag -i and pass the ekb key as the argument value.

Can I now also burn the OEM_K1 fuse? I’ve read in the Developer Guide that all fuses must be burned together.

You don’t necessarily have to flash them all at once, but it’s recommended that you do. If you flash the SecurityMode with value 1, then you won’t be able to flash some of the keys, such as Oem_K1. Seeing as though you did, you probably can’t reburn anything. I know you can burn the additional public key hashes if those weren’t burned before. When I burned my Orin, I kept SecurityMode with value 0 because I might need to burn more fuses later. SecurityMode essentially locks the rest of the fuses from being burned again, if they weren’t already burned.

To put it simply, SecurityMode locks the fuse configuration once burned. You might be able to burn Oem_K! but I doubt you’ll be able to with SecurityMode active. If you can’t burn it, you’ll need to use 0s as the Oem_K1 key, which is the example key in the OP-TEE folder.

If you need to download the package with OP-TEE, on the Jetson download page where you download BSP and the root filesystem, it’s the hyperlink named “Driver Package (BSP) Sources”.

hello menahem,

>> Q1. Why does this prevent the device from booting? I would expect to see an error message, but the monitor remains black.
please gather the UART logs for digging into the failure booting messages

>> Q2. Can I now also burn the OEM_K1 fuse? I’ve read in the Developer Guide that all fuses must be burned together.

that’s correct.