ObliviOS Developer portal Project site

Home / Decisions / ADR-196

Amend ADR-186 and ADR-187 for the exit service on the device.

Proposed, recorded 27 October 2026.

Decision
ADR-196
Date
2026-10-27
Status
ProposedProposed (landed on the build server 2026-10-27 as vendor/freeholdos/exit 98da765 and system/sepolicy 5c67042e2; built into lynx image 2026102303 (IMG-017), the policy is compiled and check-sepolicy.py and check-neverallows.sh pass on it; NET-009 is to be repeated on a device)
Mentions
ADR-186, ADR-187
Mentioned by
ADR-198, ADR-199

1Decision

Amend ADR-186 and ADR-187 for the exit service on the device. (1) exitd runs with the supplementary group inet (3003) as well as its own gid (exit.rc: group 2961 inet); exitd_route gets no group. (2) The two control sockets are trusted objects and the two service domains trusted subjects for MLS: exitd_socket and exitd_route_socket are mlstrustedobject, exitd and exitd_route are mlstrustedsubject (system-sepolicy/0004); exit_app keeps levelFrom=all, so its data stays apart from other apps and users by category. (3) Rejected: levelFrom=none for exit_app (it would run at s0), and mlstrustedsubject on exit_app.

2Why and evidence

NET-009 on lynx 2026102302. [measured] (debug builds of exitd, scratch copies of exit-daemon, run from /data/local/tmp and never shipped): exitd ended at TcpListener::bind("127.0.0.1:0") with Os { code: 13 } and no SELinux denial; the same uid and gid 2961 with no supplementary group failed and with only 3003 succeeded.

[verified-in-source] (plat_sepolicy.cil of the image): the allow rule of exit_app on exitd_route_socket exists (line 30983) and is denied by the MLS constraints of line 498 (write on sock_file: equal levels, a trusted subject or a trusted object) and line 532 (connectto: equal levels, a trusted subject, or the target domain a trusted subject), and exit_app runs at s0:c202,c256,c512,c768 against s0.

open and search on app data need dom l1 l2 (lines 465 and 474), so with exit_app at s0 every other app would dominate its level and MLS would no longer keep the data of the exit app from them, or from the decoy user; AGENTS.md forbids a regression of an upstream hardening, so s0 for the app is rejected although it is the shortest patch.

Prior art: network_stack, heapprofd and serialservice use the same attributes in this tree (private/network_stack.te:3, private/heapprofd.te:10 and :15, private/serialservice.te:4). No neverallow in private/ or public/ excludes mlstrustedsubject or mlstrustedobject for these domains (read in source, not compiled).

3Consequences

The daemon domains bypass MLS as subjects but have no allow rule on any app data file; only exit_app may write the sockets or connect to the domains (the neverallows of exit_app.te, rule 5 of check-sepolicy.py), so a compromised exitd reaches no more of the apps than before. The group inet gives exitd the kernel-side permission to open inet sockets, which it needs for Tor and which its policy already allowed.

The kernel mechanism that refuses a process with only its own gid is not identified (netd.c inet_create denies only a uid with NO_INTERNET set and uid 2961 has no entry, and the kernel config has no ANDROID_PARANOID_NETWORK) [assumption]. Further denials can show only on a device.

4Review when

NET-009 still fails with a new denial; check-sepolicy.py or check-neverallows.sh fails on the built policy; a neverallow appears that names a trusted subject; the exit app is moved to another level.

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