ObliviOS Developer portal Project site

Home / Decisions / ADR-186

Close out Compartments with one plan (2026-10-21-compartments-close-out.md) and amend ADR-184 and ADR-181.

Proposed, recorded 21 October 2026.

Decision
ADR-186
Date
2026-10-21
Status
ProposedProposed (owner chose the scope, D-K, D-L, the route helper and to have the other choices filled in with the recommendations, 2026-10-21). Nothing of it is built. The steering mechanism was tested on a phone before any code depended on it (MSK-008, NET-008, 2026-10-21): steering of an app's DNS and of a fake address range works, the F01 guard works in the kernel, and the fall-through when the daemon is gone is as stated below; the gate of Task 2 is passed.
Part
Compartments, Network exit
Mentions
ADR-181, ADR-184
Mentioned by
ADR-184, ADR-187, ADR-188, ADR-196, ADR-199, ADR-223

1Decision

Close out Compartments with one plan (2026-10-21-compartments-close-out.md) and amend ADR-184 and ADR-181. (1) Scope of v1: per-app Direct or Tor, plus masked destinations as the default tier after one consent.

Not in v1: an own WireGuard profile, a two-hop relay (D-I), bridges (D-A), UDP over Tor, interception of DNS-over-HTTPS or of strict Private DNS, a Setup Wizard step (the consent of ADR-181 section 5 is asked by one notification at the first unlock, for every user), the stallion image and signing round.

(2) Three components instead of two: the data plane exitd (tun, Arti, sock_diag, DNS split, no routing right), a route helper (exitd --routes, a second init service of the same binary in its own SELinux domain, with NETLINK_ROUTE rights only, no internet socket, no Tor, accepting only a closed set of rule shapes inside a fixed priority band and one table), and the platform-signed exit app, which owns the policy: it registers the Tor network, sets the preference, sends the route specification to the helper and the uid classes (Tor, Masked, Exempt) and per-company overrides to the daemon.

The daemon therefore still cannot change routing, as ADR-184 and the threat model state; a compromised exit app can ask the helper only for the closed shapes.

(3) Masked destinations work by DNS, replacing the per-address set of design section 4.2 option 1: rules steer the port-53 queries of masked uids and a fake address range (198.18.0.0/15 and fd66:7265:6568::/48, not the 10.0.0.0/8 that Onionmasq uses, which collides with LANs) into the tun; the daemon answers a listed name with a per-app fake address that it carries through Tor by name and forwards every other query verbatim to the resolver the app used; flows to a fake address are accepted, any other flow of a masked uid is reset, QUIC to a fake address is refused with ICMP port unreachable (D-J).

(4) Rule band 13100 to 13999 and table 4747: after the secure-VPN rule (13000), so an always-on VPN wins (F04), and before the explicit-network rules (15000, 16000) that the resolver's DNS sockets match. A guard in the band (goto and prohibit rules) stops a uid set to Tor from selecting another network by id (F01).

(5) The control sockets are created by init and authenticated by the peer SELinux context of the exit app, not by a uid, because a platform app gets its uid at install.

(6) Owner decisions: D-K quota 64 MiB for Arti and a hard limit of 160 MiB in the service definition; D-L aws-lc-sys accepted as a known risk (own domain, no framework right, no routing right); D-E first scope advertising, analytics, attribution of the classifier minus a hand-checked deny list; D-F the unit of the user's choice is the company; D-G notify after 3 failures or 5 s of slowness within 10 minutes; D-H consent once, preselected on, by notification (changed from Setup Wizard plus notification, because the wizard was never read); D-J refuse listed QUIC.

2Why and evidence

Route rights and netd priorities [verified-in-source: system/netd/server/RouteController.h:34-82 and system/sepolicy/private/dhcp.te, app_neverallows.te on the build server, 2026-10-21]: netd uses rule priorities 10000 to 32000, dhcp is allowed nlmsg_write on its own route socket with the same pattern, and no neverallow blocks a new domain from it.

The resolver marks its DNS sockets with the app's network id and the explicit-select bit, and their owner is the app uid [verified-in-source: NetworkController.cpp:237-266 and the F03 measurement of ADR-184]. Onionmasq already dispenses fake addresses per isolation key and maps them to host names [verified-in-source: exit-daemon/third_party/onionmasq/crates/onion-tunnel/src/dns.rs:46-217].

The owner's phone runs an always-on VPN with lockdown on stallion [measured: project notes 2026-09-29], which is why the band must lie behind the VPN rules.

3Consequences

One more init service and SELinux domain (about 300 lines and 1 to 2 MB), and a closed rule language to review. Masked destinations depend on the app's DNS passing through the daemon: while the daemon is down, DNS of masked uids may go Direct (the app shows "masking paused", a connection to an old fake address reaches nothing) and a crash loop is a DNS outage of masked apps, so the restart must be fast and the pause visible.

Apps with DNS-over-HTTPS, and every app on a network where Private DNS works, are not masked and not broken: the resolver's DNS-over-TLS sockets belong to AID_DNS, so no rule by app uid sees them, and refusing port 853 for everyone would switch off encrypted DNS for the whole phone, a regression of a hardening feature.

The exit app reads LinkProperties.isPrivateDnsActive(), shows the tier as limited on such a network and never changes the user's Private DNS setting (found by MSK-008, 2026-10-21). Every masked DNS query costs one user-space hop (measured in MSK-002c). The fake range and the DNS split are patches of the vendored library (0004, 0005, 0006 in the package).

4Review when

A rule in the band does not win over the resolver's marked sockets (Task 2 question b); the resolver does not fall back to port 53 when port 853 is steered away (Task 2 question e) and strict Private DNS turns out to be the owner's setting; the secure VPN rule does not precede the band on the device; the sweep MSK-002c shows a regression beyond noise that a deny list cannot remove; the hard limit mechanism of init cannot be set in this tree; a review finds that the closed rule shapes allow a redirect of non-app traffic.

Read from docs/governance/decision-log.md, entry ADR-186.