Skip to content

Guard MSD fallbacks and simplify upstream compatibility - #167

Merged
0cwa merged 3 commits into
mainfrom
integration/msd-build-diagnostics
Nov 8, 2026
Merged

0cwa merged 3 commits into
mainfrom
integration/msd-build-diagnostics

Conversation

@0cwa

@0cwa 0cwa commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Why

The reviewed production jobs completed final OTA verification and publication, but LineageOS pdx235 still emitted source-AVB warnings and MSD v2.5's emulator su fallback. A successful helper exit was therefore insufficient to describe those logs as clean or to establish correct MSD HAL targeting.

What changes

  • Add a consumer-side diagnostic runner around the existing pinned helper. It streams logs unchanged, distinguishes the explicit source and each output, and rejects output/unclassified AVB test-key or insecure-flags warnings, the MSD debug fallback, incomplete verification-log coverage, and MSD injection without compiled-policy coverage (including the unqualified direct-CIL path).
  • Retain bounded JSON/Markdown diagnostics and an Actions summary on success or failure. Cryptographic verification remains in the helper; the report is not an authentication receipt or device acceptance.
  • Disable MSD in the scheduled pdx235 preset and default it off in manual LineageOS builds. Explicit selections still pass through the guard. GrapheneOS shiba keeps MSD enabled. Release notes identify the selection and link to build diagnostics.
  • Add bounded, read-only observation of the gadget init service and its actual SELinux process label. Different, missing or ambiguous domains remain warnings; su is rejected. Export/unexport, HAL coordination, USB recovery and AVC inspection remain device checks.
  • Include the committed diagnostic code digest in the common selection fingerprint. Reject pre-existing local OTAs so a file left after a rejected build cannot bypass the guard on retry.
  • Consolidate the identical production/development helper manifests, remove the retired module Path import workaround, and document the remaining upstream boundaries and removal conditions. The helper revision and signed MSD archive are unchanged.

Validation

  • 34 diagnostic-runner tests and 23 device-audit tests pass.
  • Module selection/argv and failure ordering, workflow routing, schedules, shared identity/cache invalidation, root-mode and Magisk output checks pass.
  • The strict compatibility-transform suite passes against the actual pinned helper, including refusal, idempotence and rollback cases.
  • Source care-map, synthetic publisher-identity, repaired-helper and publication-policy regression suites pass. Local source-bundle acceptance/tamper cases were skipped because no verified bundle was supplied; the existing CI generates and checks that bundle.
  • Shell syntax, workflow YAML parsing, fallback secret scan and git diff --check pass.
  • Replayed all three cited job logs with exact source/output paths and selected-MSD coverage:
Historical job New guard result Source AVB warnings Output AVB warnings MSD fallback
Graphene production Pass 0 0 0
Lineage production Reject fallback 3 0 1
Pre-integration Lineage Reject fallback 3 0 1

Fresh paired OTA qualification

CI run 42411870728 completed successfully for head 75a028ee3b23c4a118f9a3adf9cbe6f256f5b946. The CI merge checkout 07a616d2cea043738cb14683f7a4e9abd5a51c8b has the exact same tree as the reviewed head. The full test job passed, including the compiled-policy and corresponding-source bundle checks.

Job Source and both final OTAs Saved diagnostic report
GrapheneOS shiba Verified; MSD enabled and injected into two compiled policies passed; complete coverage; 0 source/output/unclassified warnings; no fallback
LineageOS pdx235 Verified; MSD disabled as configured passed_with_warnings; complete coverage; 3 source AVB warnings, 0 output/unclassified warnings; no MSD injection or fallback

Both fresh helper logs and retained JSON/Markdown reports were inspected. Reports remain explicit that runtime validation is not_tested. These were nonpublishing builds; production publication jobs were skipped.

Remaining acceptance

This mitigates unqualified MSD delivery; it does not claim that MSD is fixed on pdx235 hardware. The pinned Qualcomm source provides a candidate mapping, but the actual installed domain, compiled policy and functional behavior must be observed before re-enabling MSD. See the qualification checklist and upstream maintenance guide.

Final combined qualification (2026-11-08)

After merging #168, CI run 42529754007 passed for combined head 2272a15781f64f1b17422395830aa5dbc9fc4f9a. The full test job and both nonpublishing paired OTA qualification jobs succeeded. GrapheneOS shiba source and both outputs verified with diagnostic status passed. LineageOS pdx235 source and both outputs verified with passed_with_warnings: three source AVB warnings (AOSP keys/flags), no observed output AVB warnings, and no MSD injection/debug fallback. Physical-device MSD acceptance remains outstanding; pdx235 MSD stays disabled.

Merged into main after code review and these checks. The separate Lineage-only BCR policy is tracked in #169.

Keep source AVB warnings visible and reject unsafe output warnings, MSD debug fallback, and missing compiled-policy coverage before publication. Disable unqualified pdx235 MSD defaults, add a bounded read-only HAL-label audit, and fingerprint the diagnostic policy.

Consolidate the shared helper compatibility manifest and remove the retired Path-import workaround without modifying the pinned helper or upstream MSD archive.
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a7fbc1ff-c2d6-4644-bb40-2ca4473cbb45
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@0cwa
0cwa marked this pull request as ready for review November 7, 2026 20:54
Recognize the pinned MSD policy tool's load/save warning blocks and older-Android type fallbacks rather than reporting a warning-free build. Scope detail collection to consecutive lines, preserve the existing security-error classification and bounded reporting, and add eleven regression tests.

This is a diagnostic follow-up to PR #167; it does not change signing, module archives, SELinux policy rules, or pdx235 MSD defaults.

0cwa commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Follow-up review found an additional reporting gap, addressed in #168 (stacked on this PR's current head; this branch is unchanged).

The diagnostic guard previously returned passed with zero warnings for MSD v2.5's unprefixed policy load/save warning blocks and Type not found: …; assuming old version of Android messages. This was reproduced with synthetic logs matching the pinned upstream spellings; it does not establish that those additional messages appeared in the historical production jobs.

#168 retains these diagnostics with bounded, scoped details, preserves the existing fatal MSD/AVB checks and original log streaming, and adds 11 regressions. All 45 diagnostic tests pass locally, along with Python compilation and git diff --check. Wider CI status belongs to #168 and is not inferred from this PR's existing OTA qualification.

Recommended review order: merge #168 into this branch, validate the combined head, then consider this PR for main. The pdx235 MSD defaults, module archives and policy rules are unchanged by the follow-up; actual HAL/policy and physical-device functional qualification are still required before re-enabling MSD. No production publication or merge was performed.

…61108

fix: retain unprefixed SELinux build warnings
@0cwa
0cwa merged commit e6e27d7 into main Nov 8, 2026
6 checks passed
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