forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to lanes/ecimagewallclock.report.mdClear filter

2026-10-03

ec-image r2: the byte bound is an independent measurement, not the guard's own statementAhmet Kaan Gümüş · a4ec8d5
ec-image r2: the byte bound is an independent measurement, not the guard's own statement

Reframes the claim after the refutation pass found it unsound: AllocBudget::spend sums declared bytes at chosen call
sites while the counting allocator sums actual layout.size() (realloc full new size included) plus the refusal's own
formatting, so 'refused at the budget' does not by itself mean 'allocated no more than the budget' -- the lane's own
red proof is the counterexample (5120024246 bytes against 4294967296). The bound is described as an independent
measurement and the red proofs as tests of the correspondence. The SIGKILL mutation is labelled evidence about the
mutation's severity, not a proof of the bound. The emulated concurrency figures are marked inferred, not recorded.
Traffic (not net live bytes) is stated as the deliberate quantity.

2026-10-02

ec-image: bound the animation budget tests by bytes, not by wall clockAhmet Kaan Gümüş · 46c7995
ec-image: bound the animation budget tests by bytes, not by wall clock

The WebP budget test asserted `elapsed < 2000 ms` and failed on a server
with 3.894534671s. That clock was never measuring the property the test
exists for. The decode is refused once the running total crosses
max_total_alloc; what the test protects is that the refusal happens
before decode_frames clones the whole canvas once per ANMF chunk. The
cost of a refused decode is a deterministic function of the budget and
the canvas size -- wall time is the host's memcpy bandwidth for a fixed
~4 GiB of traffic, which is exactly what differed between the hosts.

Measured, same input, 15 runs each: release 0.747/0.759/0.893 s (min/med/
max), debug 0.774/0.779/0.821 s, server 3.895 s. A 5x spread with
byte-identical decoder work. The existing 2000..3000 ms rerun escape
hatch does not help: 3.895 s falls outside the rerun window.

Replace it with a thread-local counting global allocator in the test
binary and bound the work in bytes against the decoder's own
max_total_alloc. The ceiling is not a fitted constant: it is the limit
the guard enforces, so "refused at the total budget" and "allocated no
more than the total budget" are the same statement.

Each budget test now decodes both a 64-frame and a 4096-frame file and
bounds both, so the cost cannot grow with the attacker's frame count --
a guard spent per input frame, or after the clone instead of before it,
is caught here, and no clock could tell those apart.

Red proof: moving budget.spend from before the clone to after it (one
canvas clone too many) reds on the byte bound at 5120024246 bytes. The
same mutation measures 1.006 s median through the old clock and would
have passed -- that is what decides it. Under load (16-40 spinners plus
direct-write memory hammers, load average 46) decode elapsed reaches
2.42-9.34 s, reproducing the server condition locally, while the new tests
stay green at 6.94-13.81 s per run.

Same class swept in the same file: the GIF budget test's 5 s ceiling, the
60000x60000 GIF frame's 100 ms ceiling, and the LZW bomb's 1 s ceiling
all become byte bounds (measured 4.096 GB, 421 B, and far under 1 MiB
respectively).

The tally is per-thread rather than a global atomic: cargo test runs
these in parallel, and a shared counter summed concurrent decodes
together (reported 6144529702 for a decode that allocates 4096023126).

cargo test -p ec-image scoped green: fuzz 18, differential 19,
real_library 2.