This project adds an Ada/SPARK allocator for Redis 7.4.2. It is built as a static library and linked into a patched Redis build so that freed blocks are cleared before they are reused. The repository also keeps proof logs, a zeroization check, and a benchmark snapshot as release evidence.
- Architecture:
docs/architecture.md - Proof audit:
docs/proof-audit.md - Threat model:
docs/threat-model.md - Contributing guide:
CONTRIBUTING.md - Security policy:
SECURITY.md
“Zeroization on free” means the allocator overwrites a block with zeroes before returning it to the free pool. This matters because data such as passwords, tokens, or request payloads can otherwise remain in memory after the application is done with them. Clearing the bytes reduces the chance that later code, diagnostics, or memory reuse exposes stale secrets.
In this allocator, formal verification means using SPARK and GNATprove to check the code against stated contracts and safety rules. The proof run can confirm things like initialization, flow dependencies, range checks, and contract conditions for the analyzed units. It is evidence about the checked code, not a guarantee about every Redis configuration or external caller.
GNATprove strict-profile summary (build/obj/gnatprove/gnatprove.out):
- Total checks: 237
- Flow checks: 83
- Prover checks: 154
- Unproved checks: 0
- Max steps used: 6759
- Most difficult proved checks: no check exceeded 1 second
- Detailed report states
0 pragma Assume statementsfor analyzed entities. - Source scan found no
pragma Assumeorpragma Trustedpragmas.
make prove
if grep -RIn --include='*.adb' --include='*.ads' --include='*.gpr' -E 'pragma[[:space:]]+(Assume|Trusted)' src config secure_allocator.gpr; then
exit 1
fibuild/obj/gnatprove/gnatprove.outscripts/prove_secure_pool.shgnatprove.conf
Scope: this audit covers the analyzed SPARK entities and contracts in this repository snapshot.
Clearing memory on free costs time. That extra work can reduce throughput or increase latency compared with a plain allocator, especially under allocation-heavy workloads. In return, it lowers the chance that sensitive data stays in memory after free. The current benchmark snapshot is in build/bench-secure.csv.
From the project root:
make setup
make build-allocator
make prove
make build-redis
make verifymake setupprepares the Ada toolchain.make build-allocatorbuilds the allocator library.make proveruns GNATprove on the SPARK allocator code.make build-redisbuilds Redis with the secure allocator enabled.make verifyruns the zeroization check against the built Redis server.
Release evidence is copied to build/artifacts/release-evidence/.