Qualcomm Linux Security Overview
Qualcomm Linux Security Overview
80-70020-11 AC
1 Security overview 3
1.1 Qualcomm Linux product security . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Watch video on IoT security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Next steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7 References 137
7.1 Related documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
7.2 Acronyms and terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
and configurations.
• Storage security: Offers encrypted storage for digital rights management (DRM) keys and
certificates. These keys are securely provisioned. The replay protected memory block
(RPMB) is a separate partition in the universal flash storage (UFS) device designed for
secure data storage.
• Secure boot: Offers image authentication and tamper-resistant root of trust (RoT) in
electronic fuses (eFuse).
• Debug security: Allows debugging in a secure environment. It’s set by an eFuse and restricts
the invasive (INV) and non-invasive (NINV) debug capabilities in commercial products and
reverse engineering. For more information, see Learn the architecture - Before debugging on
Armv8-A.
• Access control: Prevents unauthorized code execution using the access-controlled memory
and peripherals.
• Qualcomm® Trusted Execution Environment (Qualcomm TEE): Isolates the secure and
non-secure software operations. It’s built on the Arm® TrustZone® architecture and has a
rigorously reviewed small code base.
• Qualcomm Hypervisor: Allows many operating system environments to run simultaneously
and independently.
• Qualcomm® wireless edge services (WES): A cloud-based service that ensures trust
throughout the device lifecycle using hardware RoT. Qualcomm WES provides services such
as hardware-based attestation, zero-touch device provisioning, and chipset feature
management.
Security architecture
Arm® v8 has enhanced the TrustZone technology to incorporate security into its architecture. This
technology offers a security framework that allows a device to handle security threats at both
software and hardware levels.
Note: The architectural information is for comprehension purposes only. You don’t need to
perform any configuration or customization.
Arm’s hardware solution allows the design and deployment of software, applications, or services
within a secure execution environment. This environment is a separate execution unit that ensures
hardware isolation from non-secure execution environments. For more information, see Qualcomm
TEE.
Qualcomm Linux operates on a 64-bit Arm 8.x architecture. In this setup, Arm cores have two
execution modes:
• Non-secure mode: Linux operates in this mode of the Arm core.
• Secure mode: Qualcomm® Trusted Execution Environment (TEE) and trusted applications
operate in this Secure mode of the Arm core.
The secure mode of the Arm core forms the essence of the TrustZone technology. It provides a
hardware-based security environment for a secure OS and separates the secure world from the
non-secure world.
The following figure shows the Qualcomm Linux security software architecture. It shows the
distribution of components or modules across both the rich (user space and kernel space) and
trusted execution environments.
This user space includes the primary security modules/interfaces present in the Linux user space,
which operates in non-secure EL0 according to the Arm exception levels.
• MINK - Linux (MINK platform/system listener services/transport mechanism)
• Provides the services and transport mechanism to use the Qualcomm TEE capabilities
through trusted applications.
• Forms the system listener services, designed to extend the Qualcomm TEE functionalities.
The MINK interface is also commonly known as SMC invoke.
• Implements the global platform TEE client APIs for running global platform-based trusted
applications through libGPTEEC and libMTEEClibraries. For more information,
see TEE Client API Specification.
• Implements client applications in a rich execution environment (Linux user space). It interacts
with the trusted application that operates in Qualcomm TEE. The various client applications
include:
– SMC invoke-based/MINK client applications
– Client application that’s developed using MINK/SMC invoke APIs
– Global platform-based client application
– Client application that’s developed using the global platform-based TEE client API
specification
• Key management
• The cryptographic client library (libckteec) interfaces with the PKCS#11
interface of TEE. User space applications running on Linux can use this library for
direct access to the PKCS#11 interface.
• The libckteec library defines the interface between an application and a
cryptographic device, enabling applications to treat cryptographic devices as
tokens and perform cryptographic functions as implemented by these tokens.
• The PKCS#11 interface provides a range of cryptographic services for encryption,
decryption, signature generation, signature verification, and permanent key
storage.
The figure shows key management in the kernel and user space.
Qualcomm offers a software development kit (SDK) for developing and building trusted
applications. This SDK includes the necessary build system, header files, and library
dependencies to compile trusted applications.
• Trusted applications. See Qualcomm TEE → Trusted applications.
• To develop the SMC invoke trusted applications, global platform trusted applications, and
IDL/Object-based Qualcomm TEE, service APIs are available to licensed developers with
authorized access. For more information, see Qualcomm Linux Security Guide - Addendum.
The secure monitor, a component of TrustZone, is responsible for managing the transition between
the secure and non-secure worlds.
It operates in Monitor mode, which is activated by running the secure monitor call (SMC) instruction
from a privileged Arm mode.
The secure monitor ensures correct context saving and restoration when switching between the
non-secure and secure worlds. Additionally, it handles the initial processing of secure interrupts.
Security features
Qualcomm Linux incorporates several security features designed to protect devices and
applications. These features are essential for defending against vulnerabilities, ensuring data
integrity and confidentiality, maintaining compliance with industry standards, and supporting overall
system stability.
Qualcomm TEE further enhances these security capabilities. It provides interfaces that enable the
extension of the security feature set through trusted applications. The hardware-supported
TrustZone architecture integrates certain features, providing a system security configuration.
These features can be further customized to meet specific requirements.
Explore the following security features and videos in this section.
Cryptography
Key management
Secure boot
Storage security
Storage encryption
SMC invoke
Access control
SELinux
Qualcomm TEE
Qualcomm Hypervisor
Security hardening
Qualcomm WES
Cryptography
Symmetric
cipher • AES-128/AES-256 CBC, ECB, • AES-128/AES-192/AES-256
CTR, CCM, GCM, CBC, ECB, CTR, CCM, XTS,
• Triple-TDES CBC/ECB CFB, OFB, CTS
• Triple-TDES CBC/ECB
• PBKDF2
• SM4
Key management
The Qualcomm Linux Security solution supports public-key cryptography standards through the
implementation of PKCS#11 APIs. This allows applications to manage and use cryptographic keys
and certificates in a platform-independent and standardized manner.
Qualcomm implements PKCS#11 as a global platform interface for running trusted applications
within the Qualcomm TEE. A corresponding implementation is also available in the rich execution
environment (REE), allowing seamless integration and interoperability between secure and
non-secure application domains.
For more information, see the following documents:
• PKCS #11 Cryptographic Token Interface Base Specification
• PKCS #11 Cryptographic Token Interface Usage Guide
Limitations
The following functionalities aren’t supported:
• Random number generator functionality
• P-192 in CKM_ECDSA
Secure boot
Secure boot is the boot up sequence that establishes a trusted platform for the entire software
stack.
See the workflow to understand the secure boot and UEFI secure boot process.
• Ensuring that the code run by the device UEFI firmware is secure and trusted before the
operating system begins boot up.
• Defining how the UEFI authenticates images such as the Linux image, the operating system
loader ([Link]), systemd boot ([Link]), and the device tree blob (DTB) image files.
• Ensuring that the images are loaded only when signed by valid and authorized users. This
process also ensures that the Qualcomm Linux security and integrity over systems running
on UEFI-based firmware.
The UEFI secure boot allows the Qualcomm Linux users to:
• Verify the integrity and security of a UEFI loaded image, ensuring it’s loaded in an approved
manner.
• Manage the Qualcomm Linux security policy as defined by the UEFI secure boot
authenticated variables, which includes:
– Platform key (PK)
– Key exchange keys (KEK)
– Allowed database (dB)
– Forbidden database (DBX) (Not supported in this release.)
Storage security
The secure file system (SFS) stores sensitive data, such as keys and biometric data.
SFS
SFS provides confidentiality, integrity, and anti-rollback support to the trusted applications and
securely stores sensitive data. The anti-rollback protection covers the files created or stored under
SFS . The SFS feature:
• Uses an encryption key for each trusted application to ensure the confidentiality of the files.
• Uses an HMAC key for each trusted application to verify the integrity of the files.
Both the encryption and HMAC keys are derived using a device unique key, which depends on the
secure boot state of the device. The SFS anti-rollback protection is enabled by default.
When the devices are secure boot enabled, the SFS uses unique hardware keys for file data
encryption and decryption to ensure they’re secure from each other.
RPMB
RPMB is a physical partition on the UFS/eMMC flash. This partition is used to store sensitive
information and is only accessible from Qualcomm TEE.
To read from and write to the RPMB partition, RPMB key provision is required. This is a one-time
process that can’t be overwritten or erased when completed.
Every access to the RPMB is authenticated, allowing the host to store data in an authenticated and
replay-protected manner.
Storage encryption
Storage encryption enhances security by supporting the transparent encryption of files and
directories.
The Qualcomm Linux supports storage encryption with the Inline crypto engine and a
hardware-wrapped key. It provides better efficiency and enhanced key protection.
The storage encryption feature allows:
• Provision of standard keys ranging from 32 bytes to 64 bytes for content encryption
• Encryption of filenames and file content with separate keys
• Generation of 32-byte key identifiers
The Qualcomm universal flash storage (UFS) driver is added to support the fscrypt API.
For more information about the fscrypt API, see Filesystem-level encryption (fscrypt) Linux
kernel documentation.
For related kernel documentation, see the following files:
• Inline encryption
• I/O control (IOCTL) support for storage encryption
You can invoke the storage encryption functionality using the open-source fscryptctl tool.
SMC invoke
The secure monitor call (SMC) invoke is used to expose the services and interfaces implemented
in Qualcomm TEE to Linux clients. It provides identification information about the requesting
processes to Qualcomm TEE.
The SMC invoke is an object-oriented, capability-based framework that enables communication
between Linux clients, TrustZone, and the TrustZone applications, which use mini-kernel (MINK)
invoke objects.
During the SMC invoke process, the following objects are involved:
The SMC invoke driver in the kernel is responsible for transporting user space requests
between the TrustZone and the Linux user space clients. It exposes the following input/output
controls (IOCTL).
– SMCINVOKE_IOCTL_INVOKE_REQ
– SMCINVOKE_IOCTL_ACCEPT_REQ
– SMCINVOKE_IOCTL_SERVER_REQ
– SMCINVOKE_IOCTL_ACK_LOCAL_OBJ
• Linux user space:
The SMC invoke in the user space includes [Link] and the SSGTZD
daemon.
SMCInvoke driver
• The driver in the Linux kernel communicates with
application clients and the trusted applications in
the TrustZone.
• The SMC invoke driver source code is available at
/kernel/drivers/soc/qcom/smcinvoke/
smcinvoke.c.
Access control
Access control ensures only authorized entities can access specific resources under defined
conditions, using policies, technologies, and trust models.
The access control trust model ensures ongoing security by managing access control
configurations among various assets, interfaces, SoC (system on chip) components, and images.
This model helps support the integrity and confidentiality of sensitive information.
• The Qualcomm access control uses an external protection unit (xPU) to control access from
the secondary side for registers, fixed address, and dynamic memory regions.
• The system memory management unit (SMMU) controls access from the primary side for
content protection and subsystem memory sharing use cases.
Access control domains
The two levels of control are:
1. The TrustZone manages the TrustZone-domains and controls access from the secondary
side using xPUs.
• An xPU is a combination of many security blocks known as protection units. It allows
conditional access based on a set of programmable access control registers.
• If the system denies access, the xPU generates an error output signal and, if necessary,
an interrupt request signal.
2. The hypervisor (EL2) manages the non-secure domains, including the content protection
zone (CPZ) that’s designed to prevent access to premium videos.
• It configures access control from the primary side through the second-stage page
tables through the SMMU.
• It manages stage-2 mappings to protect assets across all primary domains (Linux,
display, GPU, and video). The Linux kernel manages stage-1 mappings to protect the
assets in applications that run at the user privilege level.
The figure shows the access control domains.
The secure peripheral image loading (PIL) of a TrustZone authenticates different images and
configures the xPUs for all subsystems such as audio, camera, and video.
For more information about xPU, see Access control.
SELinux
SELinux is a security enhancement for Linux, providing greater control over system access. It
implements mandatory access control (MAC) in the Linux kernel using the Linux security modules
(LSM) framework.
For more information, see What’s SELinux?
The LSM framework includes the following controls:
• Discretionary access control (DAC)
– This is the standard form of Linux access control. The data owner has full control over the
resource (such as data and files) and can update or modify the data.
– Some applications (with root privilege) can override this control. Some resources, like the
socket, are unchecked.
– Access controls are provided with limited granularity, based on user and group identity. For
example, File mode -rwxr-xr-x-.
• MAC
– A system-wide security policy determines the Linux access controls for all processes,
objects, and operations.
– The policy can confine flawed and malicious applications or incautious users. It can even
prevent users from escalating privilege such as root or UID 0.
– MAC provides finer granularity to access controls, allowing access to many more
resources other than files with more specific controls. For example, unlink, append only,
or move a file.
The figure shows the steps in the decision-making chain for DAC and MAC:
SELinux layers
The SELinux dynamic layer incorporates essential SELinux-specific code modifications that
activate and initialize the device when SELinux is enabled with a monolithic design.
Qualcomm TEE
Qualcomm TEE is the software that operates within the Arm TrustZone environment on the
Qualcomm device.
The TrustZone is a hardware-based security architecture enabled through a Secure mode of the
Arm processor. It establishes two execution environments with system-wide hardware-enforced
isolation. For more information, see What’s TrustZone?.
Qualcomm offers a 64-bit Arm 8.x processor system with hardware virtualization to run TrustZone.
In the TrustZone architecture, there are two security states:
• Secure
• Non-secure
At the EL0, EL1, and EL2 exception levels, the processor can be in either the secure state or the
non-secure state while EL3 is always in the secure state.
The operating system runs in non-secure EL1. The transition from Non-secure to Secure mode is
Qualcomm Hypervisor
Qualcomm Hypervisor provides a modern virtualization framework that allows multiple operating
systems to run independently and concurrently, delivering high performance.
Qualcomm Type-1 Hypervisor facilitates the hosting of multiple trusted execution environments for
secure use cases. The figure shows the Qualcomm Hypervisor software architecture, components,
and virtual machines. It also includes an example of one guest virtual machine using the Linux
kernel.
Security hardening
Security hardening is a process that minimizes the risk of system attacks by making it more
challenging for attackers to exploit the system vulnerabilities.
Kernel security hardening aligns with upstream kernel guidelines. Key kernel flags like KASLR,
hardened user copy, stack protector, and permissions (RWX) are enabled.
User space hardening
The security_flags.inc file, a part of the Yocto Project is used to enable security compiler and linker
flags for a build.
To extend this feature to the Qualcomm modules, add the following command to
qcom-security_flags.inc (file path: qcom-security_flags.inc):
require conf/distro/include/security_flags.inc
Adding these flags may result in warnings or errors that can disrupt a build. However, Yocto
provides a way to disable certain compiler flags for problematic packages. Modern compilers such
as GCC and Clang offer a wide range of compiler flags that can make it more difficult for an
attacker to exploit certain types of vulnerabilities.
The following are the example flags with GCC:
• The Wformat flag adds compile-time checks to detect issues related to the format of string
arguments in common library functions such as printf, scanf, and strftime.
• The D_FORTIFY_SOURCE flag adds compile and runtime checks to detect buffer overflows
in memory and string functions.
• The Fstack-protector flag adds runtime checks to detect buffer overflows and stack
smashing.
• The Fpie flag enables position-independent code, which allows for loading the binary at
randomized locations, thus making certain types of attacks (like return-oriented
programming) more difficult.
• The Wl,-z,relro,-z,now flag makes it harder to abuse a binary global offset table.
If there are warnings and errors, customizing these flags for some modules can break a build. The
binaries in a file system can be verified if the compiler exploit mitigation features are applied using
the Checksec tool.
For information about making images more secure, see The Yocto Project Documentation.
Qualcomm WES
Qualcomm WES is a suite of trusted services, rooted in hardware, which securely connects and
manages devices.
It provides the following services:
• Feature licensing enables device features identified by a feature ID and an alias feature
name. These features are enabled by installing the corresponding feature licenses or
certificates.
• Device attestation provides cryptographically signed and encrypted data items that describe
the security state of the device and its software. These data items are useful for risk engines
and other similar applications.
• Secure provisioning enables the generation and use of cryptographic keys that are secured
using unique device keys. These keys are used to:
– Securely provision data to the device post-sale and over-the-air (OTA).
– Sign data on the device.
To install or upgrade QCS5430 SoftSKU feature packs, see: Install or upgrade SoftSKU feature
packs.
To develop applications that offer hardware-based attestation, zero-touch device provisioning, and
chipset feature management, see: Qualcomm Linux Wireless Edge Services Guide. This feature is
available to licensed users with authorized access.
Security tools
To build secure software on Qualcomm devices using TrustZone and secure boot, the key tools
needed are SecTools v2 and LLVM compiler for Arm® , targeting the Snapdragon® devices.
SecTools v2 is a suite of Qualcomm security tools designed to support secure boot, image
authentication, debug policy creation, and fuse programming across Qualcomm SoCs. The LLVM
compiler for Qualcomm TEE is a specialized toolchain used to build secure software components
for TEE on Qualcomm devices.
Build system
For more information about the toolchain, build process, and compilation, see Qualcomm Linux
Build Guide.
Table : SecTools v2
Document Description
SecTools V2: Metabuild Secure Image Perform the secure-image operations on metabuild
User Guide software images.
SecTools V2: Fuse Blower User Guide Create and sign the fuse blower images. When
a device uses a fuse blower image, it blows the
specified fuse.
SecTools V2: ELF Tool User Guide Generate, add segments, and combine the ELF
software images.
SecTools V2: MBN Tool User Guide Add the modem configuration binary (MBN) headers
to binary images.
SecTools V2: ELF Consolidator User Create the consolidated ELF software images.
Guide A consolidated ELF has the contents of many
subsystem images.
SecTools V2: Secure Image User Guide Sign, encrypt, and inspect Qualcomm software
images.
SecTools V2: Secure Debug User Guide Generate and sign the debug policy images to
enable device debugging and authentication.
Note: The SecTools guides are available to licensed users with authorized access.
Next steps
• To initialize and configure the hardware for running securely on Linux, see Verify security
configurations.
• To configure Qualcomm TEE for securing devices that handle sensitive data and run trusted
applications, see Configure security services.
The security verification process involves checking and validating the security features of hardware
and software components to ensure they operate securely on Qualcomm Linux. This process
ensures that the listed security features meet the necessary requirements to make the system
robust and secure.
Prerequisites
• Build and load the software on the device.
• Enable the secure shell (SSH) in permissive mode to securely access your host device.
CONFIG_SECURITY_SELINUX=y
4. Verify the SELinux enforce status from the console or connect to the device
using SSH.
getenforce
enforcing - if selinux is set to enable
/usr/lib/
libmink*
libGPMTEE*
libGPTEE*
ls -l /dev/smcinvoke
Caution: Once RPMB is provisioned with test keys on a non-secure device, it becomes
irreversible. As a result, secure boot can’t be enabled on such devices.
Note: This feature is available to licensed users with authorized access to verify the Qualcomm
WES status. If you have access, see Qualcomm Linux Wireless Edge Services Guide.
Note: This feature is available to licensed users with authorized access to develop and run trusted
and client applications. If you have access, see Qualcomm Linux Security Guide - Addendum.
Qualcomm Linux Security provides a wide range of security configurations aimed at enhancing
device security, ensuring software authenticity and integrity, and protecting critical and sensitive
information for both developers and users.
This section guides you through the following configuration workflows.
Enable SELinux
cd trustzone_images/build/ms
QCS5430/QCS6490
EACAANAA
IQ-9075/IQ-9100
MAKAANAA
IQ-8275/IQ-8300
FAQAANAA
IQ-615
GABAANAA
Build commands
QCS5430/QCS6490
python3 trustzone_images/build/ms/build_all.py
CHIPSET=kodiak devcfg
IQ-9075/IQ-9100
python3 trustzone_images/build/ms/build_all.py
CHIPSET=lemans devcfg
IQ-8275/IQ-8300
python3 trustzone_images/build/ms/build_all.py
CHIPSET=monaco devcfg
IQ-615
python3 trustzone_images/build/ms/build_all.py
CHIPSET=talos devcfg
Important: The devcfg_iot.mbn file isn’t being generated by default. Apply the following changes
to build devcfg_iot.mbn.
trustzone_images/build/ms/build_config_deploy_lemans.xml
@@ -60,9 +60,12 @@
<alias build-once="false" disable="false" internal-test=
"false" recompile="true" strip="false" name="devcfg_auto_
sgvm">
<artifact name="devcfg_auto_sgvm"/>
</alias>
+ <alias build-once="false" disable="false" internal-test=
Next steps
• To enable secure boot and to ensure only trusted applications runs on the device, see Enable
secure boot.
• To enable secure boot, QFPROM fuses must be blown. This is a one-time, irreversible
process that permanently sets these values. For more information, see Set the QFPROM
fuses.
Note: Qualcomm doesn’t provide guidance on how to secure these keys. It’s recommended to
follow standard security protocols, obtain keys/certificates from a trusted certification authority
(CA), and protect these keys using a hardware security module (HSM).
Keys and certificates that are self-generated using the OpenSSL tool don’t have a link to any
certificate authority.
Note: The terms metabuild, meta, and meta paths are used interchangeably to indicate the
path from the Qualcomm ChipCode™ Portal. The metabuild denotes the complete
Qualcomm ChipCode release for a build.
For Linux:
setenv SECTOOLS=/<chipset>.LE.X.x/common/sectoolsv2/ext/
linux/sectools
export SECTOOLS=/<chipset>.LE.X.x/common/sectoolsv2/ext/
linux/sectools
Note: The SecTools guides are available to licensed users with authorized access.
QFPROM fuses store cryptographic keys that authenticate software images during the secure boot
process. This ensures that only authorized software can run on the device.
QFPROM uses a fusing mechanism to program registers by blowing fuses, thereby storing
permanent data This is a one-time operation that can’t be undone. The following table captures the
QFPROM fuse values and details, which enable secure boot after blowing the fuses.
QCS5430/QCS6490
Read permissions
Secondary Key 7801A8 24 1 After provisioning the SKDK,
derivation Key Read blow this bit to secure the
disable secondary key from being
read back. A secure path
hardware exists from SKDK
to the crypto engine.
Write permissions
Read permissions 7801B0 6 1 Blow this bit after the region
write disable has been provisioned to
disable further QFPROM
changes to this region.
FEC enables write 7801B0 8 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
OEM configuration 7801B0 9 1 Blow this bit after the region
write disable has been provisioned to
disable further QFPROM
changes to this region.
Public key hash 0 write 7801B0 17 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
OEM secure boot write 7801B0 23 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
Secondary key 7801B0 24 1 Blow this bit after the region
derivation key write has been provisioned to
disable disable further QFPROM
changes to this region.
FEC enable
OEM Config
WDOG_EN 7801C0 14 1 Prevents the WDOG_
DISABLE GPIO from
disabling WDOG, freeing up
the GPIO and preventing
potential abuse by an
attacker.
SHARED_QSEE_ 7801C0 30 1 A shared Qualcomm
SPIDEN_DISABLE TEE secure invasive
debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
SHARED_QSEE_ 7801C0 31 1 A shared Qualcomm
SPNIDEN_DISABLE TEE secure non-invasive
debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
SHARED_MSS_ 7801C4 32 1 A shared MSS invasive
DBGEN_DISABLE debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
PK hash
PK hash 0[0:383] 780248 [0:383] The OEM-specific root
• certificate PK hash value.
IQ-9075/IQ-9100
Read permissions
Secondary Key 780190 31 1 After provisioning the SKDK,
derivation Key Read blow this bit to secure the
disable secondary key from being
read back. A secure path
hardware exists from SKDK
to the crypto engine.
Write permissions
Read permissions 780198 5 1 Blow this bit after the region
write disable has been provisioned to
disable further QFPROM
changes to this region.
FEC enables write 780198 7 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
OEM configuration 780198 8 1 Blow this bit after the region
write disable has been provisioned to
disable further QFPROM
changes to this region.
Public key hash 0 write 780198 24 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
OEM secure boot write 780198 30 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
Secondary key 780198 31 1 Blow this bit after the region
derivation key write has been provisioned to
disable disable further QFPROM
changes to this region.
FEC enable
OEM Config
WDOG_EN 7801A8 14 1 Prevents the WDOG_
DISABLE GPIO from
disabling WDOG, freeing up
the GPIO and preventing
potential abuse by an
attacker.
SHARED_QSEE_ 7801A8 30 1 A shared Qualcomm
SPIDEN_DISABLE TEE secure invasive
debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
SHARED_QSEE_ 7801A8 31 1 A shared Qualcomm
SPNIDEN_DISABLE TEE secure non-invasive
debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
SHARED_MSS_ 7801AC 32 1 A shared MSS invasive
DBGEN_DISABLE debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
PK hash
PK hash 0[0:383] 7802A0 [0:383] The OEM-specific root
• certificate PK hash value.
IQ-8275/IQ-8300
Read permissions
Secondary Key 780190 31 1 After provisioning the SKDK,
derivation Key Read blow this bit to secure the
disable secondary key from being
read back. A secure path
hardware exists from SKDK
to the crypto engine.
Write permissions
Read permissions 780198 5 1 Blow this bit after the region
write disable has been provisioned to
disable further QFPROM
changes to this region.
FEC enables write 780198 7 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
OEM configuration 780198 8 1 Blow this bit after the region
write disable has been provisioned to
disable further QFPROM
changes to this region.
Public key hash 0 write 780198 24 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
OEM secure boot write 780198 30 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
Secondary key 780198 31 1 Blow this bit after the region
derivation key write has been provisioned to
disable disable further QFPROM
changes to this region.
FEC enable
OEM Config
WDOG_EN 7801A8 14 1 Prevents the WDOG_
DISABLE GPIO from
disabling WDOG, freeing up
the GPIO and preventing
potential abuse by an
attacker.
SHARED_QSEE_ 7801A8 30 1 A shared Qualcomm
SPIDEN_DISABLE TEE secure invasive
debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
SHARED_QSEE_ 7801A8 31 1 A shared Qualcomm
SPNIDEN_DISABLE TEE secure non-invasive
debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
SHARED_MSS_ 7801AC 32 1 A shared MSS invasive
DBGEN_DISABLE debug disable bucket. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
PK hash
PK hash 0[0:383] 7802A0 [0:383] The OEM-specific root
• certificate PK hash value.
IQ-615
Read permissions
Secondary Key 780150 22 1 After provisioning the SKDK,
derivation Key Read blow this bit to secure the
disable secondary key from being
read back. A secure path
hardware exists from SKDK
to the crypto engine.
Write permissions
Read permissions 780158 3 1 Blow this bit after the region
write disable has been provisioned to
disable further QFPROM
changes to this region.
FEC enables write 780158 5 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
OEM configuration 780158 10 1 Blow this bit after the region
write disable has been provisioned to
disable further QFPROM
changes to this region.
Public key hash 0 write 780158 12 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
OEM secure boot write 780158 20 1 Blow this bit after the region
disable has been provisioned to
disable further QFPROM
changes to this region.
Secondary key 7801B0 22 1 Blow this bit after the region
derivation key write has been provisioned to
disable disable further QFPROM
changes to this region.
FEC enable
OEM Config
WDOG_EN 780188 14 1 Prevents the WDOG_
DISABLE GPIO from
disabling WDOG, freeing up
the GPIO and preventing
potential abuse by an
attacker.
APPS_APB_DFD_ 780188 30 1 When blown will disable
DISABLE Qualcomm® Kryo™ B
Scandump using APB bus.
A corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
DCC_DEBUG_ 780188 31 1 When blown will be used to
DISABLE disable DCC IP in hardware.
A corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
DEBUG_BUS_ 78018C 32 1 When blown will be used
DISABLE to disable debug bus from
appearing on GPIOs. A
corresponding Qualcomm
fuse can override this
OEM-controlled fuse.
PK hash
PK hash 0[0:383] 7801C8 [0:383] The OEM-specific root
• certificate PK hash value.
Next steps
• To ensure the that the cryptographic keys and certificates are generated and managed in a
secure and trusted environment, see Generate keys and certificates.
• To ensure the authenticity and integrity of software images and to write a complete software
image, see Sign and flash the images.
The version 3 (v3 and v3_attest) extensions define the certificate format and establish the
Certificate Authority (CA). This process allows you to create a local CA with specific attributes and
constraints set by the v3 extensions, allowing you to issue certificates for testing and development
purposes.
Follow these steps to generate a local root key and certificate.
1. Create an [Link] using the following sample OpenSSL configuration file:
OpenSSL is an open-source toolkit for secure sockets layer (SSL) and transport layer
security (TLS) protocols, offering cryptographic functions and a command-line tool.
The following sample OpenSSL configuration file is used for generating certificate requests
and managing a Certificate Authority (CA).
#
# Copyright (c) 2013 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies,
Inc.
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate
requests.
#
[ new_oids ]
# We can add new OIDs in here for use by 'ca' and 'req'.
# Add a simple OID like this:
# testoid1=[Link]
# Or use config file substitution like this:
# testoid2=${testoid1}.5.6
#########################################################
###########
[ ca ]
default_ca = CA_default # The default ca section
#########################################################
###########
[ CA_default ]
emailAddress = optional
#########################################################
###########
[ req ]
default_bits = 1024
default_keyfile = [Link]
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca # The extensions to add to the
self signed cert
certificate request
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = AU
countryName_min = 2
countryName_max = 2
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 4
challengePassword_max = 20
[ usr_cert ]
basicConstraints=CA:FALSE
keyUsage = nonRepudiation, digitalSignature,
keyEncipherment
# subjectAltName=email:move
#nsCaRevocationUrl = [Link]
pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName
[ v3_req ]
subjectKeyIdentifier=hash
#authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature,
keyEncipherment
[ v3_ca ]
# PKIX recommendation.
subjectKeyIdentifier=hash
#authorityKeyIdentifier=keyid:always,issuer:always
[ crl_ext ]
# CRL extensions.
# Only issuerAltName and authorityKeyIdentifier make any
sense in a CRL.
# issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always
[ proxy_cert_ext ]
# These extensions should be added when creating a proxy
certificate
basicConstraints=CA:FALSE
#nsCaRevocationUrl = [Link]
pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName
authorityKeyIdentifier=keyid,issuer
subjectKeyIdentifier=hash
basicConstraints=CA:true,pathlen:0
keyUsage=keyCertSign
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE,pathlen:0
keyUsage=digitalSignature
extendedKeyUsage=codeSigning
3. Prepare the environment, create a directory named OEM-KEYS to generate all certificates
and keys at one location.
• For Linux, use the following commands:
Note: The PK HASH used for fusing in QFPROM region is SHA-384 for all configurations,
irrespective of the signature algorithm used.
Select one of the supported algorithms to enable secure boot on the device using either ECDSA or
RSA.
• Option 1: Generate ECDSA root key and certificate.
• Option 2: Generate RSA client application key pair and certificate.
For support cryptographic algorithms see the Cryptographic algorithms table.
cd ./OEM-KEYS
2. Generate the intermediate Certificate Authority (CA) key pair and certificate:
openssl x509 -inform PEM -in ca_pem.crt -outform DER -out qpsa_
[Link]
2. To generate the attestation client application key pair and certificate, run the following
commands using RSA with a key size of 2048:
The SHA-384 hash is crucial in cryptographic applications for several reasons, including enhancing
security strength, creating digital signatures, ensuring compliance with standards, and
future-proofing. SHA-384 will be used as the RoT and ensure the authenticity and integrity of
software images
To generate the SHA-384 hash of the root certificate, run the following command:
Next steps
• To ensure the authenticity and integrity of software images and to write a complete software
image, see Sign and flash the images.
• To enforce strict access controls, see Enable SELinux.
Image signing is a security process that involves adding a cryptographic signature to a digital
image. This signature serves as a unique identifier, verifying the authenticity, integrity, and origin of
the image. Without image signing, there is no assurance of an image’s integrity or trusted origin,
leading to potential security breaches and data loss.
Follow these steps to sign the images.
1. You can sign the images using SecTools V2. Different signing methods and secure image
functionality are available. For more information see SecTools V2: Secure Image User Guide.
2. You can generate the keys and certificates using a local signer. For more information,
see Generate local (insecure) root key and certificate.
3. To sign a single image, run the following command, where [Link] is used as an example.
Note: You can replace the values of oem-id “0x1” and oem-product-id “0xabcd”
according to your requirement.
<meta>/common/sectoolsv2/ext/linux/sectools secure-image
--sign /path/to/[Link] --image-id=TZ --security-profile
<meta>/common/sectoolsv2/lemans_security_profile.xml --
oem-id=0x1 --oem-product-id=0xabcd --anti-rollback-
version=0x0 --signing-mode=LOCAL --root-certificate=./
OEM-KEYS/qpsa_rootca.cer --ca-certificate=./OEM-KEYS/
qpsa_attestca.cer --ca-key=./OEM-KEYS/qpsa_attestca.key -
-outfile ./signed_images_out/[Link]
4. Check for images with the pil_split flag in the [Link] file.
Example: pil_split = "adsp"
For images that should be split, use the --pil-split option.
5. For signing the complete metabuild, use the following commands.
For more information, see SecTools V2: Metabuild Secure Image User Guide.
Note: The SecTools guides are available to licensed users with authorized access.
Generating a signed [Link] image involves creating a secure executable and linkable format (ELF)
file with a cryptographic signature. Signing this image ensures its authenticity, integrity, and origin.
A fuse blower binary is used to permanently disable certain functionalities or components of a
device for security reasons. Generating a signed [Link] image along with a fuse blower binary
involves a series of steps to ensure both the integrity of the firmware and the security of the device.
To generate fuse blower binary, see SecTools V2: Fuse Blower User Guide.
This section provides sample commands only. The following are sample commands for SecTools
on Windows.
Note:
• You can replace the values of oem-id “0x1” and oem-product-id “0xabcd” according to your
requirement.
• You can replace the value of --fuse-pk-hash-0 with the SHA384 of OEM-KEYS/qpsa_
[Link].
For more information, see Generate SHA-384 hash for RSA and ECDSA.
• Replace the digest generated here from the user Root cert in the [Link] generation
command below.
QCS5430/QCS6490
<meta>/common/sectoolsv2/ext/Linux/sectools fuse-blower -
-security-profile <meta>/common/sectoolsv2/kodiak_
security_profile.xml --fuse-pk-hash-0=<sha384 of OEM-
KEYS/qpsa_rootca.cer> --fuse-oem-secure-boot1-pk-hash-in-
fuse --fuse-oem-secure-boot1-auth-en --fuse-oem-secure-
boot2-pk-hash-in-fuse --fuse-oem-secure-boot2-auth-en --
fuse-oem-secure-boot3-pk-hash-in-fuse --fuse-oem-secure-
boot3-auth-en --fuse-oem-hw-id=0x0001 --fuse-oem-product-
id=0xabcd --generate --sign --signing-mode=LOCAL --root-
certificate=./OEM-KEYS/qpsa_rootca.cer --ca-certificate=.
/OEM-KEYS/qpsa_attestca.cer --ca-key=./OEM-KEYS/qpsa_
[Link] --oem-id=0x1 --oem-product-id=0xabcd --
outfile basic_sec.elf
IQ-9075/IQ-9100
<meta>/common/sectoolsv2/ext/Linux/sectools fuse-blower -
-security-profile <meta>/common/sectoolsv2/lemans_
security_profile.xml --fuse-pk-hash-0=<sha384 of OEM-
KEYS/qpsa_rootca.cer> --fuse-oem-secure-boot1-pk-hash-in-
fuse --fuse-oem-secure-boot1-auth-en --fuse-oem-secure-
boot2-pk-hash-in-fuse --fuse-oem-secure-boot2-auth-en --
fuse-oem-secure-boot3-pk-hash-in-fuse --fuse-oem-secure-
boot3-auth-en --fuse-oem-hw-id=0x0001 --fuse-oem-product-
id=0xabcd --generate --sign --signing-mode=LOCAL --root-
certificate=./OEM-KEYS/qpsa_rootca.cer --ca-certificate=.
/OEM-KEYS/qpsa_attestca.cer --ca-key=./OEM-KEYS/qpsa_
[Link] --oem-id=0x1 --oem-product-id=0xabcd --
outfile basic_sec.elf
IQ-8275/IQ-8300
<meta>/common/sectoolsv2/ext/Linux/sectools fuse-blower -
-generate --security-profile <meta>/common/sectoolsv2/
monaco_security_profile.xml --fuse-oem-secure-boot1-pk-
hash-in-fuse --fuse-oem-secure-boot1-auth-en --fuse-oem-
secure-boot2-pk-hash-in-fuse --fuse-oem-secure-boot2-
auth-en --fuse-oem-secure-boot3-pk-hash-in-fuse --fuse-
oem-secure-boot3-auth-en --fuse-oem-hw-id=0x1 --fuse-oem-
product-id=0xabcd --fuse-pk-hash-0=<sha384 of OEM-KEYS/
qpsa_rootca.cer> --sign --signing-mode=LOCAL --root-
certificate=./OEM-KEYS/qpsa_rootca.cer --ca-certificate=.
/OEM-KEYS/qpsa_attestca.cer --ca-key=./OEM-KEYS/qpsa_
[Link] --outfile basic_sec.elf
IQ-615
<meta>/common/sectoolsv2/ext/Linux/sectools fuse-blower -
-security-profile <meta>/common/sectoolsv2/talos_
security_profile.xml --fuse-pk-hash-0=<sha384 of OEM-
KEYS/qpsa_rootca.cer> --fuse-oem-secure-boot1-pk-hash-in-
fuse --fuse-oem-secure-boot1-auth-en --fuse-oem-secure-
boot2-pk-hash-in-fuse --fuse-oem-secure-boot2-auth-en --
fuse-oem-secure-boot3-pk-hash-in-fuse --fuse-oem-secure-
boot3-auth-en --fuse-oem-hw-id=0x0001 --fuse-oem-product-
id=0xabcd --generate --sign --signing-mode=LOCAL --root-
certificate=./OEM-KEYS/qpsa_rootca.cer --ca-certificate=.
/OEM-KEYS/qpsa_attestca.cer --ca-key=./OEM-KEYS/qpsa_
[Link] --oem-id=0x1 --oem-product-id=0xabcd --
outfile basic_sec.elf
• Stage 2: Complete secure boot (basic secure boot + debug disable + anti-rollback + write
permission disable):
Run the following commands.
QCS5430/QCS6490
<meta>/common/sectoolsv2/ext/Linux/sectools fuse-blower -
-security-profile <meta\>/common/sectoolsv2/kodiak_
security_profile. xml --fuse-pk-hash-0=<sha384 of OEM-
KEYS/qpsa_rootca.cer> --fuse-oem-secure-boot1-pk-hash-in-
fuse --fuse-oem-secure-boot1-auth-en --fuse-oem-secure-
boot2-pk-hash-in-fuse --fuse-oem-secure-boot2-auth-en --
fuse-oem-secure-boot3-pk-hash-in-fuse --fuse-oem-secure-
boot3-auth-en --fuse-oem-secure-boot-fec-enable --fuse-
wdog-en --fuse-shared-qsee-spiden-disable --fuse-shared-
qsee-spniden-disable --fuse-shared-mss-dbgen-disable --
fuse-shared-mss-niden-disable --fuse-shared-cp-dbgen-
disable --fuse-shared-cp-niden-disable --fuse-shared-ns-
dbgen-disable --fuse-shared-ns-niden-disable --fuse-apps-
dbgen-disable --fuse-apps-niden-disable --fuse-shared-
misc-debug-disable --fuse-eku-enforcement-en --fuse-anti-
rollback-feature-en=0xF --fuse-sec-key-derivation-
key=RANDOM --fuse-read-permissions-write-disable --fuse-
oem-configuration-write-disable --fuse-secondary-key-
derivation-key-read-disable
--fuse-write-permissions-write-disable
--fuse-public-key-hash-0-write-disable --fuse-oem-secure-
boot-write-disable --fuse-secondary-key-derivation-key-
write-disable --fuse-secondary-key-derivation-key-fec-
enable --fuse-fec-enables-write-disable --generate --sign
--fuse-oem-hw-id=0x0001 --fuse-oem-product-id=0xabcd --
signing-mode=LOCAL --root-certificate=./OEM-KEYS/qpsa_
[Link] --ca-certificate=./OEM-KEYS/qpsa_attestca.cer
--ca-key=./OEM-KEYS/qpsa_attestca.key --oem-id=0x1 --oem-
product-id=0xabcd --outfile [Link]
IQ-9075/IQ-9100
<meta>/common/sectoolsv2/ext/Linux/sectools fuse-blower -
-security-profile <meta>/common/sectoolsv2/lemans_
security_profile.xml --fuse-pk-hash-0=<sha384 of OEM-
KEYS/qpsa_rootca.cer> --fuse-oem-secure-boot1-pk-hash-in-
fuse --fuse-oem-secure-boot1-auth-en --fuse-oem-secure-
boot2-pk-hash-in-fuse --fuse-oem-secure-boot2-auth-en --
fuse-oem-secure-boot3-pk-hash-in-fuse --fuse-oem-secure-
boot3-auth-en --fuse-oem-secure-boot-fec-enable --fuse-
wdog-en --fuse-shared-qsee-spiden-disable --fuse-shared-
qsee-spniden-disable --fuse-shared-mss-dbgen-disable --
fuse-shared-mss-niden-disable --fuse-shared-cp-dbgen-
disable --fuse-shared-cp-niden-disable --fuse-shared-ns-
dbgen-disable --fuse-shared-ns-niden-disable --fuse-apps-
dbgen-disable --fuse-apps-niden-disable --fuse-shared-
misc-debug-disable --fuse-eku-enforcement-en --fuse-anti-
rollback-feature-en=0xF --fuse-sec-key-derivation-
key=RANDOM --fuse-read-permissions-write-disable --fuse-
oem-configuration-write-disable --fuse-secondary-key-
derivation-key-read-disable --fuse-public-key-hash-0-
write-disable --fuse-oem-secure-boot-write-disable --
fuse-secondary-key-derivation-key-write-disable --fuse-
secondary-key-derivation-key-fec-enable --fuse-fec-
enables-write-disable --fuse-write-permissions-write-
disable --generate --sign --fuse-oem-hw-id=0x0001 --
fuse-oem-product-id=0xabcd --signing-mode=LOCAL --root-
certificate=./OEM-KEYS/qpsa_rootca.cer --ca-certificate=.
/OEM-KEYS/qpsa_attestca.cer --ca-key=./OEM-KEYS/qpsa_
[Link] --oem-id=0x1 --oem-product-id=0xabcd --
outfile [Link]
IQ-8275/IQ-8300
<meta>/common/sectoolsv2/ext/Linux/sectools fuse-blower -
-generate --security-profile <meta>/common/sectoolsv2/
monaco_security_profile.xml --fuse-secondary-key-
derivation-key-read-disable --fuse-read-permissions-
write-disable --fuse-write-permissions-write-disable --
fuse-fec-enables-write-disable --fuse-public-key-hash-0-
write-disable --fuse-secondary-key-derivation-key-write-
disable --fuse-oem-secure-boot-fec-enable --fuse-
secondary-key-derivation-key-fec-enable --fuse-wdog-en --
fuse-eku-enforcement-en --fuse-oem-configuration-write-
disable --fuse-oem-secure-boot-write-disable --fuse-anti-
rollback-feature-en=0xf --fuse-shared-qsee-spiden-disable
--fuse-shared-qsee-spniden-disable --fuse-shared-mss-
dbgen-disable --fuse-shared-mss-niden-disable --fuse-
shared-cp-dbgen-disable --fuse-shared-cp-niden-disable --
fuse-shared-ns-dbgen-disable --fuse-shared-ns-niden-
disable --fuse-apps-dbgen-disable --fuse-apps-niden-
disable --fuse-shared-misc-debug-disable --fuse-usb-pipo-
disable --fuse-oem-secure-boot1-pk-hash-in-fuse --fuse-
oem-secure-boot1-auth-en --fuse-oem-secure-boot2-pk-hash-
in-fuse --fuse-oem-secure-boot2-auth-en --fuse-oem-
secure-boot3-pk-hash-in-fuse --fuse-oem-secure-boot3-
auth-en --fuse-oem-hw-id=0x1 --fuse-oem-product-id=0xabcd
--fuse-pk-hash-0=<sha384 of OEM-KEYS/qpsa_rootca.cer> --
fuse-sec-key-derivation-key=RANDOM --sign --signing-
mode=LOCAL --root-certificate=./OEM-KEYS/qpsa_rootca.cer
--ca-certificate=./OEM-KEYS/qpsa_attestca.cer --ca-key=./
OEM-KEYS/qpsa_attestca.key --outfile [Link]
IQ-615
<meta>/common/sectoolsv2/ext/Linux/sectools fuse-blower -
security-profile <meta>/common/sectoolsv2/talos_security_
[Link] --fuse-pk-hash-0=<sha384 of OEM-KEYS/qpsa_
[Link]> --fuse-oem-secure-boot1-pk-hash-in-fuse --
fuse-oem-secure-boot1-auth-en --fuse-oem-secure-boot2-pk-
hash-in-fuse --fuse-oem-secure-boot2-auth-en --fuse-oem-
secure-boot3-pk-hash-in-fuse --fuse-oem-secure-boot3-
auth-en --fuse-oem-secure-boot-fec-enable --fuse-wdog-en
--fuse-apps-apb-dfd-disable --fuse-dcc-debug-disable --
fuse-debug-bus-disable --fuse-aoss-aop-dfd-disable --
fuse-eud-disable --fuse-dap-deviceen-disable --fuse-apps-
dbgen-disable --fuse-dap-dbgen-disable --fuse-lpass-
turing-dbgen-disable --fuse-wcss-dbgen-disable --fuse-
aoss-aop-dbgen-disable --fuse-cam-icp-dbgen-disable --
fuse-ssc-dbgen-disable --fuse-venus-0-dbgen-disable --
fuse-a5x-isdb-dbgen-disable --fuse-mss-dbgen-disable --
fuse-apps-niden-disable --fuse-dap-niden-disable --fuse-
lpass-turing-niden-disable --fuse-wcss-niden-disable --
fuse-aoss-aop-niden-disable --fuse-cam-icp-niden-disable
--fuse-ssc-niden-disable --fuse-mss-niden-disable --fuse-
apps-spniden-disable --fuse-dap-spniden-disable --fuse-
apps-spiden-disable --fuse-dap-spiden-disable --fuse-
llcc-dsrw-disable --fuse-read-permissions-write-disable -
-fuse-oem-configuration-write-disable --fuse-secondary-
key-derivation-key-read-disable --fuse-public-key-hash-0-
write-disable --fuse-oem-secure-boot-write-disable --
fuse-secondary-key-derivation-key-write-disable --fuse-
secondary-key-derivation-key-fec-enable --fuse-sec-key-
derivation-key=RANDOM --fuse-fec-enables-write-disable --
generate --sign --fuse-oem-hw-id=0x0001 --fuse-oem-
Note: The SecTools guides are available to licensed users with authorized access.
Unified image encryption (UIE) is designed to protect image integrity by encrypting image files,
thereby preventing unauthorized tampering. This mechanism ensures that only authorized devices
can decrypt and access the original images.
For command-line usage related to UIE encryption, see SecTools V2: Secure Image User Guide.
UIE encryption isn’t supported for IQ-9075/IQ-9100 and IQ-8275/IQ-8300.
Note: The SecTools guides are available to licensed users with authorized access.
Where:
• openssl enc: Invokes the OpenSSL encryption tool.
• -aes-128-cbc: Specifies the encryption algorithm — AES with a 128-bit
key in the cipher block chaining (CBC) mode.
• -k secret: Provides the password (secret) from which the key and
initialization vector (IV) are derived.
• -P: Prints the derived key and IV instead of performing an encryption or
decryption.
• -md sha1: Specifies the message digest algorithm (sha1) used in the key
derivation function (KDF).
80-70020-11 AC May contain U.S. and international export controlled information 100
Configure security services
For example:
• salt=E2A1F3C4D5B6A798
• key=5F4DCC3B5AA765D61D8327DEB882CF99
• iv =AABBCCDDEEFF00112233445566778899
2. Copy the key to a file to make your key.
echo "5F4DCC3B5AA765D61D8327DEB882CF99" > l1_key.key
Generate a UIE [Link] file
1. Use the command to generate a UIE [Link] file.
To encrypt the binaries with the local keys, use the following arguments along with the signing
command.
80-70020-11 AC May contain U.S. and international export controlled information 101
Configure security services
Flashing images involves writing an entire image, including partitions, file systems, and data, onto a
storage device. This process helps keep the functionality, security, and performance of the device.
Follow these steps to flash the images:
1. See Set QFPROM fuses for the list of fuses to configure.
2. Replace all binaries with the signed non-Linux binaries generated in Sign the images,
including prog_firehose_ddr.elf.
To replace the PIL images, replace the existing PIL images with their corresponding signed
versions generated earlier.
• Extract the <chipset_name.LE.x.x>/common/build/ufs/bin/<chipset_
name>_fw.zip file.
• Replace the PIL split binaries and the .mdt files generated in the signed output into the
extrcted directory <chipset_name.LE.x.x>/common/build/ufs/bin/
<chipset_name>_fw/lib/firmware/qcom/<chipset_name>.
• Zip the <chipset_name.LE.x.x>/common/build/ufs/bin/<chipset_
name>_fw directory with <chipset_name>_fw.zip name.
• Recompile the Yocto build.
3. To flash all the signed binaries to the device, see Qualcomm Linux Build Guide.
4. After generating the signed images and [Link], enable secure boot:
a. Flash the signed images first without [Link] and ensure that the device boots
successfully.
b. Flash [Link] by updating the [Link] file as:
<program start_sector="207781" size_in_KB="28.0"
physical_partition_number="4" partofsingleimage="false"
file_sector_offset="0" num_partition_sectors="7"
readbackverify="false" filename="[Link]"
sparse="false" start_byte_hex="0x32ba5000" SECTOR_SIZE_
IN_BYTES="4096" label="secdata"/>
b. Flash the signed images and [Link] using the flash procedure from Qualcomm
Linux Build Guide.
c. Flash the image using PCAT.
d. Verify that the secure boot is enabled using Bring up → Verified secure boot.
5. When the secure boot is enabled, the device expects images to be flashed using a secure
programming method called validated image programming (VIP). In this release, you can
proceed with flashing the images on the secure device by disabling VIP using the following
80-70020-11 AC May contain U.S. and international export controlled information 102
Configure security services
int devprg_transfer_init(void)
{
int secboot, result;
struct vip_data *vip = &vip_data;
devprg_init_vip_state();
secboot = devprg_is_secure_boot_enabled();
// if (secboot == 0) /*comment this to set vip state to VIP_
DISABLED
vip->state = VIP_DISABLED;
result = devprg_transport_init();
return result;
}
mount -o rw,remount /
scp <[Link].x.x>/common/build/ufs/bin/QCM6490_fw/lib/
firmware/qcom/qcm6490/. root@<IP_address>:/lib/firmware/qcom/
qcm6490/
Push gfx (a660_zap) pil split binaries, a660_zap.mdt and
a660_zap.mbn from signed outout
scp <a660_zap signed output folder>/. root@<IP_address>:/lib/
firmware/
Push signed Venus binary:
scp vpu20_1v.mbn root@<IP_address>:/lib/firmware/qcom/vpu-2.
80-70020-11 AC May contain U.S. and international export controlled information 103
Configure security services
0/
reboot
9. To check for PIL loading success, check for the following logs in dmesg:
Next steps
80-70020-11 AC May contain U.S. and international export controlled information 104
Configure security services
Next steps
• To enable secure boot, QFPROM fuses must be blown. This is a one-time, irreversible
process that permanently sets these values. For more information see Set the QFPROM
fuses.
• To ensure the that the cryptographic keys and certificates are generated and managed in a
secure and trusted environment, see Generate keys and certificates.
Note: User is unrelated to a Linux user, and Type is unrelated to the kind of object it is.
80-70020-11 AC May contain U.S. and international export controlled information 105
Configure security services
Note: By default, SELinux is disabled to simplify the validation process while working with the
SoC and SDK. For commercial use, it’s recommended to enable the SELinux security feature.
Caution: If SELinux is enabled, you may not be allowed to update the anti-rollback protection
flag.
1. Check the current SELinux configuration of the device (Enforcing or Permissive mode):
getenforce
2. If it’s set to the Enforcing mode, run the setenforce command to change the mode.
a. Connect to the device using SSH.
b. Change the SELinux mode by using the following commands.
• To switch the device to Enforcing mode:
setenforce 1
setenforce 0
getenforce
80-70020-11 AC May contain U.S. and international export controlled information 106
Configure security services
2. Check the system status with getenforce on target. This command returns one of the
three values:
• Enforcing
• Permissive
• Disabled
3. To change the mode, select a mode at runtime by running setenforce with a number (this
change won’t persist after reboot).
Command Result
setenforce 1 Switch to Enforcing mode
setenforce 0 Switch to Permissive mode
80-70020-11 AC May contain U.S. and international export controlled information 107
Configure security services
reboot
b. To specify the SELinux mode in the build: Change the DEFAULT_ENFORCING build
flag to one of the three supported values: enforcing, permissive, or disabled.
conf/distro/include/[Link]
-- DEFAULT_ENFORCING = "permissive"
++ DEFAULT_ENFORCING = "enforcing"
4. The SELinux Disabled mode leaves behind many code paths that go through the SELinux
framework. These code paths aren’t useful for KPI testing or verifying bugs in the SELinux
framework. It also doesn’t allow any more access than Permissive mode.
To disable the feature for testing, remove SELinux from DISTRO_FEATURES:
conf/distro/include/[Link]
-- DISTRO_FEATURES:append = " selinux"
Next steps
• To ensure that only the verified and trusted applications are loaded during the startup
process, see Enable UEFI secure boot.
• For chipset feature management and to upgrade the chipset feature packs, see Install or
upgrade SoftSKU feature packs.
80-70020-11 AC May contain U.S. and international export controlled information 108
Configure security services
Note: Secure communications and cryptography are facilitated by the OpenSSL toolkit, while keys
and signatures for UEFI secure boot are managed by efitool.
80-70020-11 AC May contain U.S. and international export controlled information 109
Configure security services
Note:
• Create a directory and run the commands in the same location to perform these steps on a
Linux machine.
• For ECC, replace rsa:2048 with ec:secp384r1 or ec:secp256r1. For SHA384,
replace -sha256 with -sha384 in the following commands.
Generate UID
You can generate a GUID and create three new keys with self-signed certificates in CRT/PEM
format and keys in .key format:
GUID uses uuidgen to generate the signature owner GUID:
Create PK key
1. Create a PK key pair (RSA-2048) and certificate:
4. Sign and generate the .auth file with the .crt, .esl, and .key files:
80-70020-11 AC May contain U.S. and international export controlled information 110
Configure security services
4. Sign and generate the .auth file with the .crt, .esl, and .key files:
Create dB key
1. Create a dB key pair (RSA-2048) and certificate:
4. Sign and generate the .auth file with the .crt, .esl, and .key files:
80-70020-11 AC May contain U.S. and international export controlled information 111
Configure security services
80-70020-11 AC May contain U.S. and international export controlled information 112
Configure security services
/keys/authkeys/db.
auth
/keys/authkeys/KEK.
auth
/keys/authkeys/PK.
auth
cd efimountedbin
cd dtbmountedbin
80-70020-11 AC May contain U.S. and international export controlled information 113
Configure security services
directory in dtbmountedbin.
cd <workspace>/images
80-70020-11 AC May contain U.S. and international export controlled information 114
Configure security services
i. To sign the dtb file and signature file, run the following command:
openssl cms -sign -inkey < .key file > -signer < .
crt file > -binary -in <input dtb file>-out < Output
.[Link] file > -outform DER
cd <workspace>/images
sudo vi [Link]
b. Add the line timeout 2 to set the boot menu timeout and save the file.
13. To unmount the EFI binary to retrieve the latest [Link] file, run the command:
14. To unmount the DTB binary to retrieve the latest [Link] file, run the command:
15. Securely place the signed images and keys in the EFI partition on target.
Bring the device into the Fastboot mode and flash the latest [Link] file with the
fastboot command:
80-70020-11 AC May contain U.S. and international export controlled information 115
Configure security services
Note: These options are displayed when a timeout is configured. For more information, see
[Link] settings in Sign images and copy (.auth) key/signed files to EFI partition.
80-70020-11 AC May contain U.S. and international export controlled information 116
Configure security services
3. Copy the generated [Link] file into the EFI binary and provision the keys into the device.
For example, on a Linux host machine:
1. Mount the [Link] file to the <workspace> directory and create an efimountedbin
folder in the <workspace> directory.
2. Create a testkeys folder in the <workspace> directory on the Linux machine and copy
the pre-existing keys to it.
3. Sign the images:
hash-to-efi-sig-list <workspace>/efimountedbin/EFI/BOOT/
[Link] <workspace>/efimountedbin/EFI/Linux/[Link]
[Link]
sign-efi-sig-list -k keys [Link] -c [Link] db [Link] db.
auth
80-70020-11 AC May contain U.S. and international export controlled information 117
Configure security services
<workspace>/efimountedbin/loader/keys/qckeys.
5. Follow the dtb signing steps and sign the dtb images to generate a new [Link] file. For
more information, see Sign images and copy (.auth) key/signed files to EFI partition.
6. For a Linux host machine on the target:
a. Erase any existing UEFI secure boot keys and flash the EFI binary with fastboot.
b. Provision keys with systemd-boot. For more information, see Enable UEFI secure boot
from systemd-boot menu.
Note: All unsigned files are signed with other keys and authenticated with UEFI using
this method.
Next steps
• For chipset feature management and to upgrade the chipset feature packs, see Install or
upgrade SoftSKU feature packs.
• To customize memory and SEPolicy, see Customize secuity services.
• For common logging and debugging techniques, see Debug Qualcomm TEE and secure
devices.
80-70020-11 AC May contain U.S. and international export controlled information 118
Configure security services
80-70020-11 AC May contain U.S. and international export controlled information 119
Configure security services
mount -o rw,remount /
ssh root@device-ip-address
qwes_cli -f /data/<QCM5430 FP*>.pfm install
qwes_cli list
80-70020-11 AC May contain U.S. and international export controlled information 120
Configure security services
Command Output
Check the serial number: # qwes_cli list
qwes_cli list Running GetAllSerialNumber
test with multithread Disabled
Success. Len = 25
Parsing 2 serial numbers
Serial Number: 15b3
Serial Number:
3e52b512f2f47851a40fa5b30000018c86261aa1
5. Ensure you restart the device for the license to take effect.
ssh root@device-ip-address
cat /proc/device-tree/model
Note: The feature pack and model ID mapping will be {Feature Pack2: fp2
; Feature pack2.5: fp2.5; Feature pack 3: fp3}.
80-70020-11 AC May contain U.S. and international export controlled information 121
Configure security services
qwes_cli list
Running GetAllSerialNumber test with multithread
Disabled
Success. Len = 25
Parsing 2 serial numbers
Serial Number: 15b3
Serial Number: 3e52b512f2f47851a40fa5b30000018c86261aa1
ssh root@device-ip-address
qwes_cli -s 3e52b512f2f47851a40fa5b30000018c86261aa1
remove
Serial number length 20
Remove License is successful.
– Verify if the removed license serial number doesn’t appear in the license list:
qwes_cli list
Running GetAllSerialNumber test with multithread
Disabled
Success. Len = 4
Parsing 1 serial numbers
Serial Number: 15b3
–Ensure you restart the device for the removal of the license to
take effect.
80-70020-11 AC May contain U.S. and international export controlled information 122
Configure security services
Note: This feature is available to licensed users with authorized access to manage feature pack
licenses. If you have access, see Qualcomm Linux Wireless Edge Services Guide.
See also
• To learn about Qualcomm WES, see Qualcomm WES.
• To develop applications that offer hardware-based attestation, zero-touch device
provisioning, and chipset feature management, see: Qualcomm Linux Wireless Edge
Services Guide. This feature is available to licensed users with authorized access.
80-70020-11 AC May contain U.S. and international export controlled information 123
4 Customize secuity services
Customization is supported for memory and SEPolicy. For a large-size trusted application, you can
customize the memory regions.
export SHELL=/bin/bash
2. Set up the build environment. For instructions, see Qualcomm Linux Build Guide.
3. Based on the SELinux type, compile only the SEPolicy with bitbake refpolicy-mls or
bitbake refpolicy-targeted.
80-70020-11 AC May contain U.S. and international export controlled information 124
Customize secuity services
bitbake <recipe_file_name>
80-70020-11 AC May contain U.S. and international export controlled information 125
5 Debug Qualcomm TEE and secure
devices
Debug provides a set of common logging and debugging techniques to troubleshoot issues in
Qualcomm TEE, trusted and client applications, and secure devices.
Note: Run all the SSH commands in the SELinux Permissive mode. The Enforcing mode will be
supported in the future. For instructions on how to connect to the device, see Qualcomm Linux
Build Guide.
The error codes in tzbsp_log.txt are encoded in hexadecimal. You can run the following tool
to decode tzbsp_log.txt from hexadecimal to string.
1. Go to <[Link].X.X path>/trustzone_images/ssg/bsp/tz/build/tz/A53_
64/<BuildFlavor>
2. Run the following commands using python 3.
For example:
80-70020-11 AC May contain U.S. and international export controlled information 126
Debug Qualcomm TEE and secure devices
For device log collection, the TrustZone diag log buffer is part of the RAM dump, which can be
parsed using [Link] from [Link] software in the crash dump parser tool. For offline or
off-device log collection, the TrustZone diag log buffer is part of the RAM dump, which can be
parsed using [Link] (trustzone_images/ssg/bsp/qsee/build/${tz_bid:EACAANAA}) from the
[Link] software in the crash dump parser tool.
Debug using secure crash dump
You can debug Qualcomm TEE using the RAM dump. The execution region dump of Qualcomm
TEE is collected using secure crash dumps.
Devices that trigger the fuse with stage 2 [Link] are known as secure boot-enabled devices. To
debug on these devices, see SecTools v2: Secure Debug User Guide.
Note: The SecTools guides are available to licensed developers with authorized access.
• For offline or off-device log collection, the Qualcomm TEE log is available in RAM dumps
along with the kernel and journalctl logs.
80-70020-11 AC May contain U.S. and international export controlled information 127
Debug Qualcomm TEE and secure devices
Ensure that you configure the OEM_ID, PRODUCT_ID, serial number and keys, and certification
paths appropriately.
For more information, see SecTools v2: Secure Debug User Guide.
Note: The SecTools guides are available to licensed developers with authorized access.
80-70020-11 AC May contain U.S. and international export controlled information 128
Debug Qualcomm TEE and secure devices
80-70020-11 AC May contain U.S. and international export controlled information 129
Debug Qualcomm TEE and secure devices
See KBA-191202045020-1 (ZIP). For more information, see MiniDump Software User Guide.
80-70020-11 AC May contain U.S. and international export controlled information 130
Debug Qualcomm TEE and secure devices
Note: The SecTools and MiniDump guides are available to licensed user with authorized access.
Note: The modulus is used in the pub_mod in oem_config.xml file. The pub_exp
exponent is usually 65537. 0x10001 is known as the publicExponent.
80-70020-11 AC May contain U.S. and international export controlled information 131
Debug Qualcomm TEE and secure devices
3. Set the RSA public key (exponent and modulus) in the trustzone_
images/ssg/securemsm/trustzone/qsee/mink/oem/config/<chipset>/
oem_config.xml file.
Enable this feature by adding the following lines to the oem_config.xml file using:
<driver name="NULL">
<global_def>
<var_seq name="pub_mod" type=DALPROP_DATA_TYPE_STRING>
a048999983266557fc755225455392fc2729cb1435947c89bcd40ac63d0d6d
8a7d721de34ff0326641a9f6c12f79aa58ea573b296dcf40334eadecbf7844
4b2852c8e36e7701e5a3c625658c8bcc32202d295803f0d5b7f4c0d609b28e
59c13cace561043678e3da95b3e3b7719050eea9705a151aafd9a54fc270f1
f8f167d1780eb8956e93736a23f131e1e249ff1854a373d07091de7a925311
aacbb0f9d0e1839f7467bc1a896db1d2de4fab3c1c63c9bc75f0c080fcdb73
d18ae3f46057dd66f13afa18ed7f47723e4950948e19ae6b69623d74ca44fb
d41c1d594330310dfbab70449dd9d0cecb43f32a98a483e776aea8b8ea6364e1
111b9992b39b3f
</var_seq>
<var_seq name="pub_exp" type=DALPROP_DATA_TYPE_STRING>
000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000100
01
</var_seq>
</global_def>
Note: When the public key in the oem_config.xml file is updated, ensure that there are
no new line characters, tabs, or spaces inserted between due to the Notepad or Wordpad
editors.
5. To build the TrustZone devcfg image, enter the OEM_ID field value and sign the
[Link] image.
80-70020-11 AC May contain U.S. and international export controlled information 132
Debug Qualcomm TEE and secure devices
print_tz_log.py
80-70020-11 AC May contain U.S. and international export controlled information 133
Debug Qualcomm TEE and secure devices
80-70020-11 AC May contain U.S. and international export controlled information 134
6 Develop trusted and client applications
You can develop and run trusted and client applications using default files in the global platform
interfaces. The trusted applications run in a secure Trusted Execution Environment (TEE) to keep
the code and data integrity. Where as the client applications operate in the normal OS, using TEE
client APIs to perform secure services.
This feature is available to licensed users with authorized access to develop and execute trusted
applications and client applications. If you have access, see Qualcomm Linux Security Guide -
Addendum.
For developing applications that offer hardware-based attestation, zero-touch device provisioning,
and chipset feature management, see Qualcomm Linux Wireless Edge Services Guide. This
feature is available to licensed users with authorized access.
80-70020-11 AC May contain U.S. and international export controlled information 135
Develop trusted and client applications
80-70020-11 AC May contain U.S. and international export controlled information 136
Develop trusted and client applications
80-70020-11 AC May contain U.S. and international export controlled information 137
7 References
Note: MiniDump, Qualcomm Linux Security - Addendum, Qualcomm Linux Wireless Edge
Services, and SecTools guides are available to licensed users with authorized access.
80-70020-11 AC May contain U.S. and international export controlled information 138
References
80-70020-11 AC May contain U.S. and international export controlled information 139
LEGAL INFORMATION
Your access to and use of this material, along with any documents, software, specifications, reference board files, drawings, diagnostics and other
information contained herein (collectively this “Material”), is subject to your (including the corporation or other legal entity you represent,
collectively “You” or “Your”) acceptance of the terms and conditions (“Terms of Use”) set forth below. If You do not agree to these Terms of Use,
you may not use this Material and shall immediately destroy any copy thereof.
1) Legal Notice.
This Material is being made available to You solely for Your internal use with those products and service offerings of Qualcomm Technologies, Inc.
(“Qualcomm Technologies”), its affiliates and/or licensors described in this Material, and shall not be used for any other purposes. If this Material is
marked as “Qualcomm Internal Use Only”, no license is granted to You herein, and You must immediately (a) destroy or return this Material to
Qualcomm Technologies, and (b) report Your receipt of this Material to [Link]@[Link]. This Material may not be altered,
edited, or modified in any way without Qualcomm Technologies’ prior written approval, nor may it be used for any machine learning or artificial
intelligence development purpose which results, whether directly or indirectly, in the creation or development of an automated device, program,
tool, algorithm, process, methodology, product and/or other output. Unauthorized use or disclosure of this Material or the information contained
herein is strictly prohibited, and You agree to indemnify Qualcomm Technologies, its affiliates and licensors for any damages or losses suffered by
Qualcomm Technologies, its affiliates and/or licensors for any such unauthorized uses or disclosures of this Material, in whole or part.
Qualcomm Technologies, its affiliates and/or licensors retain all rights and ownership in and to this Material. No license to any trademark, patent,
copyright, mask work protection right or any other intellectual property right is either granted or implied by this Material or any information disclosed
herein, including, but not limited to, any license to make, use, import or sell any product, service or technology offering embodying any of the
information in this Material.
THIS MATERIAL IS BEING PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESSED, IMPLIED, STATUTORY OR OTHERWISE. TO
THE MAXIMUM EXTENT PERMITTED BY LAW, QUALCOMM TECHNOLOGIES, ITS AFFILIATES AND/OR LICENSORS SPECIFICALLY DISCLAIM ALL
WARRANTIES OF TITLE, MERCHANTABILITY, NON-INFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, SATISFACTORY QUALITY, COMPLETENESS
OR ACCURACY, AND ALL WARRANTIES ARISING OUT OF TRADE USAGE OR OUT OF A COURSE OF DEALING OR COURSE OF PERFORMANCE.
MOREOVER, NEITHER QUALCOMM TECHNOLOGIES, NOR ANY OF ITS AFFILIATES AND/OR LICENSORS, SHALL BE LIABLE TO YOU OR ANY THIRD PARTY
FOR ANY EXPENSES, LOSSES, USE, OR ACTIONS HOWSOEVER INCURRED OR UNDERTAKEN BY YOU IN RELIANCE ON THIS MATERIAL.
Certain product kits, tools and other items referenced in this Material may require You to accept additional terms and conditions before accessing
or using those items.
Technical data specified in this Material may be subject to U.S. and other applicable export control laws. Transmission contrary to U.S. and any other
applicable law is strictly prohibited.
Nothing in this Material is an offer to sell any of the components or devices referenced herein.
In the event of a conflict between these Terms of Use and the Website Terms of Use on [Link], the Qualcomm Privacy Policy referenced
on [Link], or other legal statements or notices found on prior pages of the Material, these Terms of Use will control. In the event of a
conflict between these Terms of Use and any other agreement (written or click-through, including, without limitation any non-disclosure agreement)
executed by You and Qualcomm Technologies or a Qualcomm Technologies affiliate and/or licensor with respect to Your access to and use of this
Material, the other agreement will control.
These Terms of Use shall be governed by and construed and enforced in accordance with the laws of the State of California, excluding the U.N.
Convention on International Sale of Goods, without regard to conflict of laws principles. Any dispute, claim or controversy arising out of or relating
to these Terms of Use, or the breach or validity hereof, shall be adjudicated only by a court of competent jurisdiction in the county of San Diego,
State of California, and You hereby consent to the personal jurisdiction of such courts for that purpose.
Snapdragon and Qualcomm branded products referenced in this Material are products of Qualcomm Technologies, Inc. and/or its subsidiaries.
Qualcomm patented technologies are licensed by Qualcomm Incorporated.