Hi!
I have some issues regarding Secure boot and Disk Encryption on l4t 35.3.1 and 35.5.0.
Issue 1: odmfuse.sh from 35.3.1 breaks PkcPubkeyHash1 and PkcPubkeyHash2 fuses on Orin AGX 32GB
Fuses cfg:
<genericfuse MagicId="0x45535546" version="1.0.0">
<fuse name="ArmJtagDisable" size="4" value="0x1"/>
<fuse name="PublicKeyHash" size="64" value="0x764e531b71d55a950cb9dcb969e72450205448aac203236d14a874a9c85c0608ff63418a378c91d0f3517e83a31898c4e5db45221738b04e9632d7772c710ee5"/>
<fuse name="PkcPubkeyHash1" size="64" value="0x7b2f9d57a2b1d78bced07cc55914dc4f1c36639a9473f7072f5d1cbb622c7d07ff5165bc59ca6d3eed7c0d9968e22824d78f4863818ad861211781191412cf2c"/>
<fuse name="PkcPubkeyHash2" size="64" value="0x4c4aa57b469b29e44776f4942dc0443fd640db8b8018e94cacdbcfc22dea1881a11f3878342614c9dd9e954a0c2ad30ce14b2d85af90de3e78178c6cc68ab3e2"/>
<fuse name="OemK1" size="32" value="0xXXXXXXXX"/>
<fuse name="OemK2" size="32" value="0xYYYYYYYY"/>
<fuse name="OptInEnable" size="4" value="0x1"/>
<fuse name="BootSecurityInfo" size="4" value="0x1"/>
<fuse name="SecurityMode" size="4" value="0x1"/>
</genericfuse>
After burning all fuses from XML including PublicKeyHash, PkcPubkeyHash1, PkcPubkeyHash2 (PKC0, PKC1, PKC2) by means of l4t 35.3.1 odmfuse.sh only PKC0 works. odmfuse.sh and UART logs say that all fuses were burnt successfully, but I can not flash Orin using pkc1 and pkc2.
Orin_fuse_uart_log_35_3_1.txt (27.6 KB)
nv_fuse_read.sh from 35.5.0 shows that PKC1 is zero and PKC2 contains wrong data with repeated 7f6fbd7f7f.
$ sudo nv_fuse_read.sh
revoke_pk_h0: 0x00000000
revoke_pk_h1: 0x00000000
pk_h1: 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
odminfo: 0x00000000
pk_h2: 0x7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f7f6fbd7f
odmid: 0x0000000000000000
system_fw_field_ratchet1: 0x00000000
system_fw_field_ratchet0: 0x00000000
system_fw_field_ratchet3: 0x00000000
system_fw_field_ratchet2: 0x00000000
optin_enable: 0x00000001
public_key_hash: 0x764e531b71d55a950cb9dcb969e72450205448aac203236d14a874a9c85c0608ff63418a378c91d0f3517e83a31898c4e5db45221738b04e9632d7772c710ee5
ecid: 0x8472624F674C0608
reserved_odm2: 0x00000000
reserved_odm3: 0x00000000
reserved_odm0: 0x00000000
reserved_odm1: 0x00000000
reserved_odm6: 0x00000000
reserved_odm7: 0x00000000
reserved_odm4: 0x00000000
reserved_odm5: 0x00000000
boot_security_info: 0x00000001
security_mode: 0x00000001
odm_lock: 0x00000000
I burnt other Orin AGX module with odmfuse.sh from 35.5.0. All PKCs work, nv_fuse_read.sh shows right PKC hashes.
Do you have fixes for 35.3.1 ?
Issue 2: Disk encryption doesn’t work on fused Orin AGX 32GB in both l4t 35.3.1 and 35.5.0
I use two fused Orins from Issue 1. One of them was fused by means of 35.3.1, other by 35.5.0.
After preparing eks_t234.img with custom oemk key and flashing Orin, disk encryption doesn’t work due to eks_t234.img can not be decrypted by TOS.
E/TC:00 00 ekb_extraction_process:321 Tried all EKB_RKs but still can't extract the EKB image.
E/TC:00 00 jetson_user_key_pta_init:974 jetson_user_key_pta_init: Failed (ffff000f).
E/TC:00 00 call_initcalls:43 Initcall __text_start + 0x001197f8 failed
However if eks_t234.img prepared with default oemk1 for 35.5.0 and default oemk1 for 35.3.1 then disk encryption works!
TOS decrypts EKS successfuly and then encrypted rootfs boots also successfully.
OemK1 and OemK2 are custom keys, they are differ from default oemk keys.
default oemk keys - keys from optee/samples/hwkey-agent/host/tool/gen_ekb/example.sh.
EKS preparation for 35.3.1:
python3 gen_ekb.py -chip t234 -oem_k2_key oemk2 \
-fv ekb_fv\
-in_sym_key ekb_krn \
-in_sym_key2 ekb_rfs \
-out eks_t234.img
if oemk2 is 432646294a404e635266556a586e3272357538782f413f442a472d4b61506453 then disk encryption works else doesn’t.
EKS preparation for 35.5.0:
python3 gen_ekb.py -chip t234 -oem_k1_key oemk1 \
-fv ekb_fv \
-in_sym_key ekb_krn \
-in_sym_key2 ekb_rfs \
-in_auth_key uefi_var_auth.key \
-out eks_t234.img
if oemk1 is 2d4a614e645267556b58703273357638792f423f4428472b4b6250655368566d then disk encryption works else doesn’t.
Why default OemK1 and OemK2 are used to decrypt EKS even on fused Orins?
What happend with OemK1 and OemK2 fuses on Orins? Were these fuses really burnt successfully or not?
Issue 3: flash.sh doesn’t work with ROOTFS_ENC=1 and with --uefi-keys at the same time in l4t 35.3.1
sudo -E NO_RECOVERY_IMG=1 ROOTFS_ENC=1 ./flash.sh --uefi-keys keys/uefi_keys.conf jetson-agx-orin-devkit mmcblk0p1
[ 0.0316 ] tegrahost_v2 --chip 0x23 0 --magicid MBCT --ratchet_blob ratchet_blob.bin --appendsigheader mb1_cold_boot_bct_MB1_aligned.bct zerosbk
[ 0.0319 ] File read failed
Error: Return value 2
Command tegrahost_v2 --chip 0x23 0 --magicid MBCT --ratchet_blob ratchet_blob.bin --appendsigheader mb1_cold_boot_bct_MB1_aligned.bct zerosbk
l4t_sign_image.sh: Error: Unable to find the signed file generated by tegraflash.py
failed.
This command works in l4t 35.5.0.
Do you have any patches for 35.3.1?