VssWarden — Mixed-Criticality COVESA VSS Safety Gatekeeper & Verification Studio for QNX 8.0 QPP

Try the live Verification Studio · Open the Interactive Codelab (/codelab) · Read the source · Watch the 45s demo film

VssWarden is an upstream-compatible C11 safety gatekeeper, priority-lease .control actuator arbiter, and property-based verification studio for BlackBerry QNX's publicly hosted QNX POSIX Publish Subscribe (QPP) resource manager on QNX Neutrino RTOS 8.0.

Target & Host Verification: Cross-compiled with QNX SDP 8.0 (qcc GCC 12.2.0) for both x86_64 (gcc_ntox86_64) and aarch64le (gcc_ntoaarch64le) via both official QNX recursive make and meson, and verified live on QNX Neutrino RTOS 8.0 (QNX noname 8.0.0 x86pc x86_64 in QEMU via mkqnximage) mounting the patched qpp resource manager at /dev/signal — see QNX SDP 8.0 Build Receipt and QNX 8.0 QEMU Live Target Receipt. Host verification additionally covers Linux json-c integration and deterministic fast-check PBT (P1..P3). Physical automotive ECU hardware has not been tested; the 45s demo film shows the host Verification Studio, while the live QNX 8.0 QEMU target terminal proof is included below.

The Studio and API execute the same C source as a bundled WASI module (runtimeEngine: "c11-wasi"). They require Node.js, not a runtime C compiler or a macOS executable. QNX priority comes from the client context; a path modifier can lower that priority but cannot raise it above ctp->info.priority.


QNX Global Hackathon Category & Bonus Prize Mapping

Track / Prize Target Category How VssWarden Delivers
Primary Category 2. Automotive & Mobility Enforces COVESA Vehicle Signal Specification (VSS v3) min, max, allowed, and arraysize bounds at the QNX QPP resource-manager boundary (ERANGE / EINVAL) and arbitrates mixed-criticality ADAS vs. IVI .control actuator writes.
Bonus Prize 1 Best Use of QNX-specific Technologies Hooks directly into QNX 8.0 resmgr_attach / <sys/iofunc.h> Open Control Block (io_close_ocb) lifecycle callbacks, client priority (ctp->info.priority / pid), CLOCK_MONOTONIC lease timers, and a zero-SDK ?warden POSIX path modifier (OP_MODE_WARDEN).
Bonus Prize 2 Best Codelab / Tutorial Ships a built-in interactive <google-codelab> tutorial at https://qnx-vss-warden.vercel.app/codelab (app/codelab/page.tsx) walking developers step-by-step through the 3 upstream QPP gaps, zero-fuzz patching, POSIX echo/cat ?warden,text arbitration, and fast-check property-based verification.

Demo Video & Visual Walkthrough

Beat 1 — POSIX .control Collision Hook (t = 9.20s) Beat 2 — Split-Timeline Priority Preemption (t = 19.45s)
Beat 1 — POSIX .control Collision Hook Beat 2 — Split-Timeline Priority Preemption
Beat 3 — Upstream QPP 3-Bug Hex Probe (t = 27.05s) Beat 4 — Crash / TTL Lease Recovery (t = 33.75s)
Beat 3 — Upstream QPP 3-Bug Hex Probe Beat 4 — Crash Lease Recovery & Seal

Web UI — Two-Channel Arbitration Bench (/) & Interactive Codelab (/codelab)

Two-Channel Arbitration Bench (/) IEEE-754 Binary32 & ?warden Inspector (/) Interactive <google-codelab> Workshop (/codelab)
Two-Channel Arbitration Bench IEEE-754 Memory Inspector Interactive Codelab Workshop

Live QNX Neutrino RTOS 8.0 Target Proof (qcc Dual-Arch + QEMU /dev/signal Execution)

QNX Neutrino RTOS 8.0 Live QEMU Target Proof


The 3 Upstream QNX QPP Safety & Correctness Gaps Fixed by VssWarden

Inspecting the upstream qnx/qnx-posix-publish-subscribe (qpp/) source code reveals three critical gaps when running mixed-criticality Software-Defined Vehicle (SDV) workloads:

  1. Unenforced COVESA VSS Bounds & 3 Upstream Value/Metadata Bugs:
    • qpp/README.md (lines 187–199): Marks the COVESA VSS attributes min, max, allowed, and arraysize as Used By QPP? NO.
    • qpp/value.c (line 73): Defines [VECTOR_UINT32] = {0, UINT16_MAX, sizeof(uint16_t), "uint32[]"}, erroneously capping 32-bit unsigned vectors at 65535 with a 2-byte element size instead of UINT32_MAX and sizeof(uint32_t).
    • qpp/value.c (lines 434–447, specifically line 438 for FLOAT and line 445 for DOUBLE): Decodes JSON floating-point defaults into json_d via json_decoder_get_double(), but assigns the zero-initialized integer json_l (0), silently corrupting every non-zero FLOAT/DOUBLE catalog default (such as 22.5 °C HVAC temperature) to 0.0.
    • qpp/metadata.c (lines 54–59): Calls json_decoder_get_string() on all metadata properties, causing queries for numeric min/max or array allowed attributes to fail with EINVAL.
  2. Blind Last-Write-Wins on .control Actuators (Actuator Hijack):
    • qpp/README.md (line 224), qpp/iowrite.c (lines 78–90), and qpp/iowrite_text.c (lines 112–124): Concurrent writes to an actuator's .control node unconditionally overwrite the previous request. A low-priority Infotainment script (Priority P10) can immediately overwrite an active emergency command from ADAS Automatic Emergency Braking (Priority P60).
  3. No Crash / Disconnect Lease Recovery (io_close_ocb) or POSIX Rejection Diagnostics (?warden):
    • qpp/ioclose.c, qpp/ioopen.c, and qpp/main.c (line 160): When a high-priority holder crashes or disconnects without releasing an actuator lock, a naive lock permanently deadlocks the actuator unless tied to io_close_ocb cleanup and CLOCK_MONOTONIC lease expiry with standby promotion or VSS default safe-state rollback. Furthermore, rejected POSIX writes return -1 without structured diagnostics explaining which rule or higher-priority owner blocked the actuation.

Repository Architecture

  • src/c/vss_warden_core.h & src/c/vss_warden_core.c: Portable C11 safety engine (libvsswarden_core) with zero QNX header dependencies, implementing comment stripping for signal_catalog.json, VSS constraint pre-compilation, priority-lease .control arbitration, io_close_ocb / CLOCK_MONOTONIC rollback, and ?warden JSON diagnostics.
  • src/c/vss_warden_cli.c: Native C11 CLI runner supporting both --preset <id> --seed <n> deterministic replay and persistent JSON batch verification.
  • patches/qpp-vss-warden.patch: Unified diff for 14 original upstream files (common.mk, meson.build, node.{c,h}, ocb.h, catalog, open, both read/write paths, close, value and metadata). scripts/apply-qpp-patch.sh checks the pinned base, applies with zero fuzz, and copies the core plus QPP adapter.
  • scripts/verify-qnx800-target.sh & docs/qnx800-verification/: End-to-end QNX SDP 8.0 (qcc / make / meson) dual-architecture build and headless QEMU QNX Neutrino RTOS 8.0 target verification harness and captured receipts.
  • lib/oracle.ts & tests/warden-core-pbt.test.ts: Independent TypeScript state-machine oracle and Shape 1 fast-check Property-Based Testing suite (P1..P3).
  • app/page.tsx & lib/studio-model.ts: Side-by-Side SDV Verification Studio (Raw QPP (Unguarded) vs. VssWarden (Guarded)) with race-safe studioReducer (activeRequestId) and clamped SVG timelines.
  • app/codelab/page.tsx: Interactive step-by-step QNX 8.0 <google-codelab> tutorial.

Reproducible Build & Verification Instructions

1. Host Build & Verification (macOS / Linux — Zero External API Keys)

Requirements: Node.js 22+, clang (C11), Git, patch, and network access to the official QNX GitHub repository for patch verification. npm test fetches the pinned upstream source into a temporary directory and removes it after verification; fetch failures fail the test.

# 1. Install dependencies
npm install

# 2. Compile the portable C11 engine and CLI binary via clang
npm run build:c

# 3. Run the complete test suite (24/24 tests: fast-check PBT P1..P3 + patch --fuzz=0 gate + Studio/Codelab tests)
npm test

# 4. Run TypeScript typechecking and Next.js production build
npm run typecheck
npm run build

# 5. Start the Side-by-Side Verification Studio & Interactive Codelab on http://localhost:3000
npm run dev

Replay any preset deterministically from the terminal in one line:

./build/vss-warden-cli --preset preset-1-bounds-float-bug --seed 20261105
./build/vss-warden-cli --preset preset-2-adas-vs-ivi-hijack --seed 20261105
./build/vss-warden-cli --preset preset-3-crash-lease-rollback --seed 20261105

2. QNX Neutrino RTOS 8.0 Target Build (Verified — x86_64 & aarch64le)

Use a licensed QNX SDP 8.0 Linux x86_64 host with qnxsdp-env.sh, GNU make, and (optionally) Meson >= 1.10 + Ninja. The official qcc reference lists gcc_ntoaarch64le and gcc_ntox86_64 for C. Full compiler and ELF NEEDED output (ldqnx-64.so.2, libm.so.3, libjson.so.1, libslog2.so.1, libc.so.6) is recorded in docs/qnx800-verification/build-receipt.txt.

source ~/qnx800/qnxsdp-env.sh
bash scripts/apply-qpp-patch.sh .scratch/qpp-patched
mkdir -p build

# 1. Cross-compile the standalone VssWarden C11 CLI for QNX 8.0 (x86_64 & aarch64le)
qcc -Vgcc_ntox86_64 -std=c11 -O2 -Wall -Wextra src/c/vss_warden_core.c src/c/vss_warden_cli.c -lm -o build/vss-warden-cli-qnx800-x86_64
qcc -Vgcc_ntoaarch64le -std=c11 -O2 -Wall -Wextra src/c/vss_warden_core.c src/c/vss_warden_cli.c -lm -o build/vss-warden-cli-qnx800-aarch64le

# 2a. Build patched QPP via upstream's official QNX SDP recursive Makefile (builds both nto/x86_64 and nto/aarch64)
(cd .scratch/qpp-patched && make)

To also cross-compile via Meson (>= 1.10), create .scratch/qpp-patched/qnx-x86_64.ini (expand /path/to/qnx800/target/qnx to your ${QNX_TARGET}):

[binaries]
c = 'ntox86_64-gcc'
ar = 'ntox86_64-ar'
strip = 'ntox86_64-strip'
[built-in options]
c_args = ['--sysroot=/path/to/qnx800/target/qnx', '-B/path/to/qnx800/target/qnx/x86_64/lib', '-B/path/to/qnx800/target/qnx/x86_64/usr/lib', '-I/path/to/qnx800/target/qnx/usr/include', '-D__QNXNTO__']
c_link_args = ['--sysroot=/path/to/qnx800/target/qnx', '-L/path/to/qnx800/target/qnx/x86_64/lib', '-L/path/to/qnx800/target/qnx/x86_64/usr/lib', '-Wl,--rpath-link,/path/to/qnx800/target/qnx/x86_64/lib', '-Wl,--rpath-link,/path/to/qnx800/target/qnx/x86_64/usr/lib']
[host_machine]
system = 'qnx'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
meson setup .scratch/qpp-patched/build-qnx-x86_64 .scratch/qpp-patched --cross-file .scratch/qpp-patched/qnx-x86_64.ini
meson compile -C .scratch/qpp-patched/build-qnx-x86_64

3. QEMU QNX 8.0 Boot, Mount and Live Verification (Verified)

On the SDP Linux host, use the official mkqnximage utility with QEMU installed (or run scripts/verify-qnx800-target.sh; captured guest session in docs/qnx800-verification/qemu-qnx800-target-run.txt and docs/qnx800-verification/qnx800-cli-preset2.json):

slay -f qpp 2>/dev/null || true
chmod +x ./qpp ./vss-warden-cli-qnx800-x86_64
./qpp -s -c ./signal_catalog.json -m /dev/signal &
./vss-warden-cli-qnx800-x86_64 --preset preset-2-adas-vs-ivi-hijack --seed 20261105

# Priority-spoofing check (P10 asking ?priority=60 -> rejected with EPERM / Operation not permitted):
on -p10 sh -c 'echo "80" > "/dev/signal/Vehicle/ADAS/CruiseControl/SpeedSet?control,text,priority=60,as=Spoofed_IVI"'

# ADAS shell (P60) preempts and holds SpeedSet?control,text at 0:
exec 3>"/dev/signal/Vehicle/ADAS/CruiseControl/SpeedSet?control,text,priority=60,lease=60000,as=ADAS_AEB"
echo "0" >&3
# IVI shell (P10), while ADAS fd 3 stays open (rejected with EBUSY; ?control,text stays 0):
echo "110" > "/dev/signal/Vehicle/ADAS/CruiseControl/SpeedSet?control,text,priority=10,as=IVI_EcoMode"
cat "/dev/signal/Vehicle/ADAS/CruiseControl/SpeedSet?warden,text"
# Release ADAS lease (io_close_ocb promotes standby IVI or restores VSS safe default 0):
exec 3>&-

Verified live on QNX noname 8.0.0 2026/10/30-09:10:05EDT x86pc x86_64: FLOAT default 22.5 loads as 22.500000, out-of-range write 99.5 fails with ERANGE, priority spoofing fails with Operation not permitted (EPERM), low-priority IVI overwrite fails with EBUSY while ADAS_AEB (pid 716820, priority 60) holds 0, ?warden,text emits the structured JSON receipt, and closing ADAS + IVI descriptors triggers io_close_ocb standby promotion (100) followed by safe default rollback (0).

4. Host QPP integration and Serverless runtime

With Git, patch, network access, libjson-c-dev, Meson and Ninja installed on Linux, npm run test:qpp-host fetches the official fixed revision (b5ca892f), applies the patch, builds and tests the real upstream handlers, then removes the temporary checkout. The default web path executes runtime/vss-warden.wasm through Node's WASI preview1 runtime (runtimeEngine: "c11-wasi"), requiring no runtime C compiler.


License

Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE for attribution and scope. The original code in this project is Apache-2.0; upstream QPP at b5ca892f carries BlackBerry Limited proprietary-rights notices requiring an express license agreement. This license does not relicense QPP or grant rights to its code. Upstream source snapshots are not bundled; scripts fetch the fixed official revision into temporary or ignored local checkouts.

Built With

Share this project:

Updates

Submission history