Skip to content

module: guard ROM-bound service-context overlays before mount - #130

Draft
Leeestephen wants to merge 1 commit into
SuperTurtleDev:mainfrom
Leeestephen:fix/ota-service-context-guard
Draft

Leeestephen wants to merge 1 commit into
SuperTurtleDev:mainfrom
Leeestephen:fix/ota-service-context-guard

Conversation

@Leeestephen

Copy link
Copy Markdown
Collaborator

Summary

Prevent a stale Anland platform service-context overlay from surviving an
Android OTA and hiding new platform service labels.

Anland generates a complete plat_service_contexts overlay at installation.
On my LineageOS 24 / Android 17 upgrade, the retained Android 16 overlay
mislabelled new services, including allowlist and media.codeclist.generator,
and caused repeated system_server crashes under enforcing SELinux.

Changes

  • Generate the overlay from the current platform file and insert the Anland
    service mapping before the wildcard.
  • Record a shared SHA-256 fingerprint that excludes Anland's own generated
    entry, supporting reinstall while the existing overlay is visible.
  • Check the fingerprint in post-fs-data.sh, before the metamodule mount stage.
    Changed or unverifiable inputs create disable and skip_mount markers.
  • Include the boot hook and fingerprint helper in the module ZIP and restore
    executable hook permissions during installation.
  • Document recovery by reinstalling the module for the current ROM, and add
    script and packaging regressions.

Testing

  • 17 host tests pass, including the actual Makefile ZIP recipe with inert
    daemon/audio fixture payloads.
  • 10 isolated fixture cases pass under KernelSU BusyBox on alioth / Android 17,
    repeated successfully under /system/bin/sh.
  • Cases cover added services, changed labels, missing/malformed inputs,
    reinstall over a visible overlay and persistent disable markers.

Run the host regressions with

python3 -m unittest discover -s tests -v

An earlier device-local implementation passed an enforcing Android 17 cold
boot. This exact extracted revision still needs a fresh flash/cold-boot check.
The guard depends on the root implementation and metamodule honoring the
pre-mount hook and disable/skip-mount markers.

Contributor workflow

For future small, tested fixes, do you prefer contributors to wait for review,
or is self-merging acceptable after an agreed review window?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant