Inspiration
A fleet operator cannot see what a QNX device in the field actually booted. A changed library or configuration file on a car ECU, an infusion pump or a PLC looks the same from the outside until it misbehaves. The attackers are also remote. Upstream Security analysed 494 automotive and mobility incidents from 2025 in February 2026 and found that 92% of automotive cyber attacks were conducted remotely and that 61% of the incidents could affect thousands to millions of assets. UN R156, the EU Cyber Resilience Act, FDA ยง524B and IEC 62443 ask manufacturers to verify software integrity in the field, some of them now and the others from 2027.
QNX 8.0 ships a TPM software stack, tss2, and a TPM driver base, tcti_tpm_driver_base.so, that loads a board vendor's hardware module. No hardware module comes with the SDP, so nothing reaches a TPM out of the box. QNX Trusted Disk checks /system blocks on the device as they are read, and UEFI firmware measures the boot image. Nothing on QNX measures the system files into a TPM or answers a remote verifier with a signed quote. Witness fills that gap.
What it does
Witness starts with dev-tpm-tis, a TPM 2.0 driver for the TIS register interface written as a QNX resource manager that serves /dev/tpm0. It is interrupt driven and falls back to polling. The DDK has no TPM framework, and its guide says to write a resource manager for such devices. The organiser confirmed in forum topic 45999 that this fits Low-level Software.
UEFI firmware measures the QNX boot image into PCR 4. Right after /system is mounted and before anything on it runs, witness-measure runs from the boot image and measures into PCR 8 every file and symlink on /system and in /etc, 253 on the demo image, together with the home directories of the root-capable logins, which hold their ssh keys and .profile. /etc holds the boot configuration that a QNX boot script sources as shell code. The applications are measured into PCR 9 before launch. Each event binds the file's type and path as well as its content, as the ima-ng template of Linux IMA does, so renaming a file without changing a byte also locks the key.
The attestation agent witnessd runs on QNX's own TCG stack, where tss2 ESYS calls our TCTI module and the module calls the driver. For the verifier's nonce it returns a TPM quote over PCR 0 to 9, the event log and a signature by the device key. The device key is a TPM key that the TPM lets the agent use only in a boot state signed by the build host's release key through TPM2_PolicyAuthorize, and only on this device's own firmware, measured in PCR 0, 2 and 7. The attestation key certifies it. witnessd runs at priority 8, below QNX's default, and reads up to 64 clients at once. Each client must send its request within 2 s, and a supervisor restarts witnessd if its TPM work for one request outlives a 10 s watchdog.
The device key does a job. witness-report, measured into PCR 9, sends a status report every 10 s. Each report is bound to a one-time challenge from the fleet service and signed by the device key through witnessd's own QNX channel, built on name_attach and MsgSend, which only the report app's security type may open. The fleet service accepts nothing else. A tampered or rolled-back device is therefore cut off from its backend by its own TPM from its next boot, with no operator action. When root asks the channel to sign, it gets "Operation not permitted".
A signed update keeps the key and a rollback loses it. demo.sh update installs release v2 as an update agent would, here over ssh, with a hardened sshd_config and its signed policy. The device is TRUSTED against v2 and its key is released again, with no re-provisioning. Releases are numbered, and once release 2 has run the TPM refuses the genuine signature of release 1 through TPM2_PolicyNV over a set-only NV bit field. demo.sh rollback reinstalls signed v1, and the device key stays locked.
A QNX security policy gives each component its own type. After boot only the measurement tool and the agent may reach the driver. Even root logged in over ssh gets "Operation not permitted" on /dev/tpm0 and cannot start a program under the agent's type. The driver, the agent and the report app run as their own uid, so root cannot read or write their memory through /proc either.
On the host, the verifier and the fleet dashboard are written in Python, and demo/fleet.sh runs three QEMU devices, each with its own TPM. The verifier predicts PCR 4, 5, 8 and 9 and all 257 file digests from the build output alone. It checks the quote, the nonce, the event-log replay and the device key's TPM policy, and it names the file that changed.
How we built it
The target code is C, cross-built with qcc and the gcc_ntox86_64 12.2 toolchain from the QNX SDP 8.0 under the QNX Everywhere licence. The image is built with mkqnximage snippets and runs on QEMU 10.2 x86_64 with OVMF UEFI and swtpm on the standard TIS interface. The host verifier is written in Python and has 105 tests. Public CI runs 103 of them on every push on a clean GitHub runner, and the other two need a built image.
Evidence of QNX use
All target code is C built as -std=gnu11 with qcc -Vgcc_ntox86_64 for QNX 8.0, and make ARCH=aarch64le builds it for ARM. The TPM TIS driver in driver/tis.c maps the TIS registers at 0xFED40000 with mmap_device_memory and waits for the interrupt with InterruptAttachThread and InterruptWait, bounded by TimerTimeout, with a polling fallback. The resource manager in driver/main.c serves /dev/tpm0 and /dev/tpm0-stats through dispatch_create and resmgr_attach, keeps a custom OCB per client and supports select and poll through iofunc_notify. The TSS2 TCTI module in tcti/tcti-witness.c is linked into witnessd, and it is also built as libtss2-tcti-witness.so.0 for QNX's libtss2-tctildr, which addresses it as witness:/dev/tpm0.
The measurement tool tools/witness-measure.c runs from the IFS and issues one raw TPM2_PCR_Extend per file. The attestation agent agent/witnessd.c uses QNX's libtss2-esys for the quote, for the device key under PolicyAuthorize with the release key and PolicyPCR, for checking the signed release policy with VerifySignature, for anti-rollback with NV_DefineSpace, PolicyNV and NV_SetBits, and for Certify. The boot customisation in image/witness-image.sh adds mkqnximage snippets for the IFS script, startup_postfs and post_start, and sets the IFS load address for current OVMF. The security policy image/witness.secpol defines the START_P types and grants mem_phys and interrupt:5 to the driver only. It is built with mkqnximage --secpol=secure.
The recorded output is in the repository. docs/evidence/golden-path.log holds the recorded run and the attack run, and docs/evidence/qnx-console-last-boot.log holds the boot console. docs/evidence/fleet-reports.log shows the signed fleet reports accepted, refused after a tamper and accepted again after the restore.
QNX-specific technologies, for the Best use of QNX-specific Technologies bonus
The TPM driver is a resource manager that serves /dev/tpm0 with resmgr_attach, a custom OCB and iofunc_notify. Every TPM command is a native QNX message to that one process. The kernel queues the clients in priority order, so only the driver holds the TPM's memory and interrupt. witnessd has its own name_attach channel, which signs fleet reports for the one app that the security policy lets connect.
The microkernel keeps hardware access in one user-space process with one 4 KiB register page and one interrupt, and the agent is a separate, supervised process. The driver follows the QNX 8.0 interrupt model with InterruptAttachThread and InterruptWait, bounded with TimerTimeout. Startup is customised with mkqnximage snippets that measure /system and /etc before any boot script reads them, and the IFS load address is moved for current OVMF. The security policy gives each component its own secpol type, and root over ssh cannot open /dev/tpm0.
The agent and the report app run at priority 8, below QNX's default of 10, so control work at the default priority or above is scheduled first. The TPM driver serves each client at that client's priority. The TCG stack is the SDP's own libtss2-esys with our TCTI module. Each of these points links to its code in the README section "QNX-specific technologies".
Challenges we ran into
Current OVMF refused the IFS as a UEFI image until we moved its load address with __BOOT_ADDR__ 64m. InterruptWait takes no timeout on QNX 8, so we bounded it with TimerTimeout(_NTO_TIMEOUT_INTR). Predicting PCR 8 from the build meant reproducing mkxfs exactly, including hard links, symlinks and the escapes in inline files. We learned the QNX security policy with secpolgenerate on full runs, a tampered boot among them, and then tightened it by hand.
Accomplishments that we're proud of
When a library inside the attestation stack itself is tampered with, the verifier names it and the device loses its key. Every software reference value comes from the build output, from the boot image and the disk layout to all 257 files, the applications and the device key's policy. Only the firmware values are recorded at enrolment.
Tools we did not write check the result. Public CI hands the three captured fleet quotes to Ubuntu's tpm2-tools, which accepts the attestation key's signature over the verifier's nonce and rejects both a wrong nonce and a quote with one byte changed. The same script, scripts/independent-check.sh, confirms that the signed PCR digest matches the PCR values the verifier judged. The first link of the chain is a standalone QNX codelab, submitted upstream to qnx/codelabs as pull request 87 and tested end to end from a fresh clone.
What we learned
Measuring /system is not enough. Outside reviews kept an attacker's ssh key, and later a .profile, in root's home on a TRUSTED device. Both are measured now. The lesson is to measure everything that a boot or a root login reads as code, and to say plainly what is left outside, as the Limits section of the README does.
Measuring contents is not enough either. A reviewer moved file contents between names without changing their order and kept the key, because each PCR event carried only a content digest. Events now bind type and path. demo.sh tamper rename renames a file within the same slot without changing a byte, and the key locks. A unit test shows that the old content-only chain would not have moved.
What's next for Witness
We want to run Witness on real TPM hardware, an SPI TPM on a Raspberry Pi 5 or a CRB firmware TPM on x86 boards. The anti-rollback NV index should be locked with an owner password or TPMA_NV_POLICY_DELETE, and the release epoch should reach beyond 63 releases. An EK certificate chain should replace trust on first use for the attestation key. The rest of /data that matters, such as the ssh host keys, should be measured or made read-only, as the Limits section of the README notes.