Skip to content

boot-module: dontaudit the permissive container domain to protect the audit backlog - #391

Open
Dry-Earth wants to merge 1 commit into
ravindu644:mainfrom
Dry-Earth:fix/sepolicy-dontaudit-container
Open

Dry-Earth wants to merge 1 commit into
ravindu644:mainfrom
Dry-Earth:fix/sepolicy-dontaudit-container

Conversation

@Dry-Earth

Copy link
Copy Markdown

Problem

On a OnePlus Ace 5 Pro (LineageOS 24, kernel 6.6.144) the device hard-freezes and is reset by the PMIC watchdog when the App terminal is closed (typing exit or pressing the tab ×). No kernel panic, no pstore.

The verified cause is the audit backlog, not the container runtime:

su-8767  mntput / fput / security_file_free        (returned)
su-8767  audit_start -> returned
su-8767  audit_end
su-8767  audit_start -> returned
su-8767  audit_end
...
su-8767  audit_start                               <-- whole kernel silent

kmsg at the same moment:

avc: denied ... comm="zsh" name=".zsh_history"
audit: audit_lost=8995 audit_rate_limit=5 audit_backlog_limit=64

audit_log_start() sleeps while skb_queue_len(&audit_queue) > audit_backlog_limit (64 here). The container runs in u:r:droidspacesd:s0, which this module declares permissive droidspacesd and which is missing several allows, so every container file operation emits an AVC record. The queue never drains, tasks sleep in audit_log_start(), and the watchdog resets the phone.

Full analysis and traces: #390

Change

Append dontaudit rules for the observed denials of the permissive container domain to Android/app/src/main/assets/boot-module/sepolicy.rule.

  • Only the audit record is dropped. The permission decision is unchanged (the domain is permissive; nothing becomes more or less allowed).
  • Other domains keep logging normally.
  • The signatures were generated from the actual avc: denied lines in the crash logs (43 target-type/class groups, permissions merged).
  • dontaudit is the standard way to stop auditing expected denials of a permissive domain, and it is the same mechanism a policy author would use.

Testing / caveats

  • Tested device: OnePlus Ace 5 Pro (hummer), LineageOS 24.0, kernel 6.6.144-4k-g01ee97578159, Droidspaces v7.2.0, daemon mode, Kali container.
  • I have not installed this patched sepolicy.rule on the device (the owner does not want phone-side changes while we are still narrowing the crash). The rules are derived from the exact denial signatures in the crash logs; they still need a run on real hardware.
  • The list is intentionally explicit (one rule per target/class) rather than a catch-all, so new/unexpected denials are still logged. Please trim any entries you consider noise.
  • If you would rather fix the missing allow rules instead of using dontaudit, that is fine too — the goal is only to stop the per-domain flood.

Related

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