Skip to content

fix: retain unprefixed SELinux build warnings - #168

Merged
0cwa merged 1 commit into
integration/msd-build-diagnosticsfrom
fix/selinux-diagnostic-coverage-20261108
Nov 8, 2026
Merged

0cwa merged 1 commit into
integration/msd-build-diagnosticsfrom
fix/selinux-diagnostic-coverage-20261108

Conversation

@0cwa

@0cwa 0cwa commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Scope and dependency

Focused follow-up to #167, based on its reviewed head 75a028ee3b23c4a118f9a3adf9cbe6f256f5b946. This PR deliberately targets integration/msd-build-diagnostics, not main, so it does not duplicate the existing mitigation or alter that branch before review. Merge this into #167 before promoting the combined change to main, or retarget after #167 lands.

Reproduced issue

While reviewing the remaining build-log concerns, I found an additional diagnostic blind spot. The pinned MSD v2.5 policy tool emits these messages without a WARN prefix:

  • Warnings when loading sepolicy: followed by - ... detail lines;
  • Warnings when saving sepolicy: followed by - ... detail lines;
  • Type not found: <type>; assuming old version of Android.

With complete source/output verification markers and a successful helper exit, the previous parser reported passed, zero warnings for each shape. This was reproduced with synthetic logs matching the upstream spellings; it is not a claim that additional policy warnings occurred in the previously reviewed production runs.

Changes

  • Recognize policy-loading/saving warning headers and retain their contiguous detail lines with operation context, line numbers, and existing phase attribution.
  • Record older-Android type fallbacks as sepolicy_compatibility_fallback warnings rather than silently treating the run as warning-free.
  • End detail collection at unrelated output, blank lines, module/verification markers, or oversized lines so unrelated log details are not retained.
  • Preserve the existing failure behavior for the MSD su debug fallback, unsafe output/unclassified AVB warnings, missing verification coverage, and helper failures. Policy-warning formatting cannot waive those errors.
  • Keep report limits, markup/control-character sanitization, original streamed bytes, and runtime_validation: not_tested intact. Explain the expanded warning-line counts in the Markdown report.
  • Add 11 regressions to the already-invoked diagnostic test suite; no CI routing changes are needed.

Validation performed

  • Verified the local baseline source/test copies against GitHub's exact blob SHAs before editing.
  • Original diagnostic suite: 34 tests passed.
  • New parser regressions against the old implementation: 10 test methods produced 19 failing subtests, reproducing the missing-warning behavior.
  • Updated diagnostic suite: 45 tests passed, including a real subprocess stdout/stderr streaming test with synthetic diagnostics.
  • python -m py_compile src/build_diagnostics.py tests/build_diagnostics_test.py passed.
  • git diff --check passed.
  • Uploaded source/test blob hashes match the locally validated files.

The full repository CI and real OTA builds were not run locally; the available local environment cannot resolve GitHub for repository/dependency downloads. This PR's normal CI can provide the wider regression check. The existing paired-OTA qualification recorded in #167 belongs to its earlier head, not to this follow-up.

Remaining physical-device boundary

This does not re-enable MSD on pdx235, modify a signed module archive, change SELinux rules or signing policy, or remove the original Lineage source-AVB warnings. #167 remains the primary mitigation. Actual gadget-HAL domain identification, compiled-policy qualification, export/unexport, HAL pause/resume, USB recovery, and AVC inspection on the physical device remain prerequisites to claiming MSD is fixed there. No ROM was flashed or published, and no PR was merged.

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.
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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: 6073dd8f-ee05-4d74-9361-b3fefb1ba7ac

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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 merged commit 2272a15 into integration/msd-build-diagnostics Nov 8, 2026
4 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