Definition
A fault-to-verdict mapping is the host’s rule that turns every possible outcome of running a guest program into the decision the host enforces, called the verdict, such as allow or reject. A guest program is code that a host runs inside a virtual machine §2.3 (VM). The outcomes include a normal return with an agreed verdict value, a normal return with any other value, and every way the run can fail: a refused memory access, an exhausted instruction budget §2.32, an error from a host function, or no program to run.
The idea
A host asks a guest program, for every incoming connection request, whether to accept it; the agreed answers are 1 for allow and 0 for reject. One run tries to read past the end of its input. The VM’s runtime bounds check §2.27 refuses the access and stops the run, so the memory protection worked. Now the host must act on the connection. If it reads the variable in which the VM normally leaves the answer, it may find 1, left there by the previous run, and accept the connection. Correct fault detection inside the VM has become an unsafe decision outside it. The fault-to-verdict mapping is the part that prevents this.
The core idea is to keep two outputs apart. The status says how the run ended: a normal return or a particular failure. The return value is the guest’s answer, and it means something only when the status is a normal return from this run. The mapping reads the status first, reads the value only after a normal return, and accepts the value only if it is one of the agreed answers. Choosing reject for a failure is called failing closed; choosing allow is failing open. A door controller that loses contact with its badge reader is a fair picture: it needs a stated rule for that case, locked or unlocked, instead of reusing the last badge’s result. Unlike the door, a VM can fail in many different ways, and the mapping needs a rule for each.
How it works
Write the mapping as a table with one row for every outcome, before any program runs.
List the agreed verdict values, for example 1 for allow and 0 for reject, and nothing else. State their width: the eBPF §2.1 (extended Berkeley Packet Filter) return register R0 holds 64 bits, so the host compares all 64.
List every failure the runtime can report. Some happen before the guest runs: no program is installed, or the loader refused the program as malformed. Others happen during the run: a memory access outside the permitted regions, an instruction the VM does not support, an exhausted instruction budget, a helper function §2.19 (a host function the guest calls) that reports an error, or a run stopped by a timeout §9.34.
Choose a verdict for each failure. The choice between failing closed and failing open is a policy decision; it goes in the table and is not left to whatever the code happens to do.
Give invalid values their own row. A normal return whose value is not an agreed verdict, such as 9, usually gets the same verdict as a failure.
At run time the host follows a fixed order.
Before the run, reset the status and the result storage, so that nothing from an earlier run can be read as this run’s answer.
Run the program and receive the status and the value.
If the status is a failure, look up that failure’s row and ignore the value.
If the status is a normal return, look up the value; a value without a row takes the row for invalid values.
Perform or refuse the protected action according to the verdict, and only after the verdict exists. Record which failure occurred separately, for diagnosis; that record must not change the verdict.
Two places need care. First, a runtime’s programming interface often reports success with the status 0, while the guest’s verdict 0 means reject. The two zeros mean different things in different outputs, and code that treats the status as the verdict inverts the policy. Second, if another thread or an interrupt handler §6.12 can read the verdict while a run is in progress, the host must publish the status and the value together, after the run has finished, so that no reader combines the status of one run with the value of another.
Linux XDP (eXpress Data Path), which runs eBPF programs on packets as they arrive at a network driver, shows a complete mapping. The agreed return values are named actions, among them XDP_ABORTED = 0, XDP_DROP = 1 and XDP_PASS = 2. A value outside the set is reported with a warning and then handled exactly like XDP_ABORTED, which drops the packet. For invalid values the mapping fails closed.
Worked example
A host uses this table: a normal return with value 1 gives allow; a normal return with value 0 gives reject; every other outcome gives reject. The runtime reports its status as a number: 0 for a normal return, for a refused memory access, for an exhausted budget. The value is the 64-bit content of R0 at the return. Five runs:
Status 0, value 1: allow.
Status 0, value 0: reject.
Status 0, value 9: 9 is not an agreed verdict, so reject.
Status , with the value storage still holding 1 from run 1: the status is a failure, so the value is ignored; reject.
Status 0, value
0x0000000100000001: the full 64-bit value is , not 1, so reject.
Two plausible bugs turn some of these into allows. A host that copies the value into a 32-bit variable keeps only the low 32 bits of run 5, 0x00000001, and allows it. A host written as allow unless the status is 0 and the value is 0 allows runs 3, 4 and 5, and every other failure too, because it rejects only one exact outcome. The condition written the other way round, reject unless the status is 0 and the full value is 1, allows only run 1.
A third bug confuses the two zeros. Code written as reject if the runtime returns 0, by someone who read 0 as the reject verdict, rejects every normal return, run 1 included, and allows every failure, because failures return or . The memory checks and the budget all work, and the host allows exactly the runs that failed.
Stated precisely
Let be the set of statuses the runtime can report, with meaning a normal return, and let be the set of agreed verdict values, for example . An outcome is a pair of a status and a 64-bit value . The mapping is a function from outcomes to verdicts. It is correct when four conditions hold.
Total: gives a verdict for every pair, including statuses added by later versions of the runtime, which fall to a default row.
Value ignored on failure: for every , is the same for every .
Membership checked: for every , is the verdict chosen for invalid values, with compared at its full 64 bits.
Fresh: both parts of come from this run; neither is left over from an earlier run.
For a fail-closed §1.13 policy with 1 meaning allow, exactly when and .
The mapping protects something only if the action waits for it. On every path through the host’s code, the protected action happens only after has produced allow for this run. A host that performs the action first and computes the verdict afterwards has a correct table and no protection.
Limits and common mistakes
Failing closed trades availability §1.10 for safety. If an attacker can make the guest fail, for example with input that exhausts its budget, a fail-closed mapping turns that input into the rejection of legitimate requests, a denial of service §1.28. The trade-off is a policy choice, made and stated per row; it is no reason to fail open §1.14 by accident.
A correct status is useless if a caller ignores it. Every caller of the runtime, including error paths and callers added later, must go through the mapping.
Not every surprising operation is a failure. In eBPF, division by zero does not stop the run: RFC 9669, the eBPF instruction set standard, defines the result of a division by zero as 0 [160]. The program returns normally, and only the check of the verdict value can catch a meaningless answer.
A valid verdict is not a correct verdict. The mapping guarantees that failures and invalid values cannot become allow; it cannot detect a program that returns 1 when it should return 0.
A reject verdict does not undo effects that happened during the run. If the guest wrote to shared state, such as a BPF map §2.18, before it failed, that write remains; the mapping decides only the protected action.
Questions answered
Are all malformed results mapped consistently to rejection?
Malformed results are mapped consistently to rejection only if the host’s mapping gives reject for every outcome other than a valid allow, and that has to be checked in the host’s code row by row rather than assumed. A fault-to-verdict mapping is the host’s rule that turns each outcome of running a guest program into the decision it enforces; a malformed result is any outcome other than a normal return with an agreed verdict value. The check has five parts.
Every failure the runtime can report has a row that says reject, both before the run (no program installed, program refused when loaded) and during it (memory fault, unsupported instruction, exhausted instruction budget, helper error, timeout).
A normal return with a value outside the agreed set is rejected, the value compared at full width: a 64-bit value of must not pass as 1.
On any failure the return value is ignored, so a value left over from an earlier run cannot become an allow.
The runtime’s success status, often the number 0, is never confused with the guest’s verdict 0.
The protected action happens only after the verdict, on every path.
Rejecting every malformed result is a fail-closed policy. It costs availability, since input that makes the guest fail is rejected even when the request was legitimate, so the choice should be written down, not left to the code.
Related entries: Fail closed (§1.13), Fail open (§1.14), Instruction budget (fuel) (§2.32), Runtime bounds check (§2.27), Deterministic invocation state (§2.35), Denial of service (DoS) (§1.28). Further reading: [160].