pub const LANDLOCK_ABI: ABI;Expand description
Landlock ABI version. We use ABI V1 because:
- It is supported by our reference kernel version.
- Later versions do not (yet) provide additional security that would benefit us.
§Versions (as of October 2023)
-
Polkadot reference kernel version: 5.16+
-
ABI V1: kernel 5.13 - Introduces landlock, including full restrictions on file reads.
-
ABI V2: kernel 5.19 - Adds ability to prevent file renaming. Does not help us. During execution an attacker can only affect the name of a symlinked artifact and not the original one.
-
ABI V3: kernel 6.2 - Adds ability to prevent file truncation. During execution, can prevent attackers from affecting a symlinked artifact. We don’t strictly need this as we plan to check for file integrity anyway; see https://github.com/paritytech/polkadot-sdk/issues/677.
§Determinism
You may wonder whether we could always use the latest ABI instead of only the ABI supported by the reference kernel version. It seems plausible, since landlock provides a best-effort approach to enabling sandboxing. For example, if the reference version only supported V1 and we were on V2, then landlock would use V2 if it was supported on the current machine, and just fall back to V1 if not.
The issue with this is indeterminacy. If half of validators were on V2 and half were on V1, they may have different semantics on some PVFs. So a malicious PVF now has a new attack vector: they can exploit this indeterminism between landlock ABIs!
On the other hand we do want validators to be as secure as possible and protect their keys from attackers. And, the risk with indeterminacy is low and there are other indeterminacy vectors anyway. So we will only upgrade to a new ABI if either the reference kernel version supports it or if it introduces some new feature that is beneficial to security.