Skip to content

Harden Linux ABI and APK inspection, and add reproducible runtime evidence - #3

Closed
3z4k wants to merge 2 commits into
aarvsn:mainfrom
3z4k:fix/runtime-correctness-and-evidence
Closed

3z4k wants to merge 2 commits into
aarvsn:mainfrom
3z4k:fix/runtime-correctness-and-evidence

Conversation

@3z4k

@3z4k 3z4k commented Oct 22, 2026

Copy link
Copy Markdown

Summary

Opening a file with O_WRONLY could truncate existing data, closing one duplicated descriptor invalidated its siblings, and registered epoll events were reported without checking readiness. APK inspection accepted ZIP-like input and supplied a fixed package name. This change corrects those behaviors and replaces broad milestone claims with bounded, testable contracts.

The resulting research harness provides actual package metadata, explicit Linux ABI translation, a cooperative executable entry/gateway experiment, and versioned host/console evidence reporting. Android environment startup remains blocked.

Implementation

Area Resulting behavior
Linux descriptors Correct Linux open flags and errno translation; native positioned I/O; shared open-file lifetimes; lowest available descriptor reuse; packed Linux x86-64 guest structures
Memory and synchronization Overflow-safe range/alignment handling; unmap rounding for larger host pages; executable guest mappings rejected explicitly; futex mismatch returns Linux EAGAIN; unsupported timeouts fail without waiting
Eventfd / epoll Blocking/nonblocking counter and semaphore semantics; overflow checks; level-triggered eventfd readiness with real wakeups/deadlines; unsupported targets/modes rejected
ELF Bounded parsing without unaligned structure casts; copied argument/environment strings and valid staged pointers; trusted ET_DYN loading with final permissions and an explicit syscall callback
APK ZIP directory/local-header validation; bounded stored/DEFLATE binary manifests; CRC checks; actual package/SDK/DEX/native-library metadata; malformed archives/XML rejected
Binder research Explicitly bounded synchronous internal RPC; distinct invalid/reserved handles; typed transaction errors; synchronized allocation; exception cleanup; concurrent/reentrant tests
PS5 lifecycle Upstream-aligned event-wait signature and bounded flip waits; direct-memory ownership/unmap cleanup; pad shutdown; actual initialization/flip/input observations
Evidence / CI JSON revision/compiler/architecture/run identifiers; explicit unknown hardware provenance; immutable SDK release/checksum; separate sanitizer jobs, seeded fuzzing and CLI checks

Documentation

The README has a source-controlled SVG banner, evidence-based capability tables and a concise quick start. The supporting documentation includes an architecture diagram and separate contracts for executable loading, RPC, APK parsing and hardware validation.

Validation

Executed locally on macOS ARM64; the x86-64 build ran under Rosetta.

Check Result
ARM64 and x86-64 host suites 78/78 tests passed in each build
AddressSanitizer + UndefinedBehaviorSanitizer Passed
ThreadSanitizer Passed
Seeded ELF/text-manifest libFuzzer smoke 10,000 executions completed without a crash
Cooperative Android-target ELF Entry executed, gateway write succeeded, exit requested, return value zero
Independent AAPT2 fixture Package org.ps5droid.inspection, min SDK 28, target SDK 35 matched
JSON/report guard Host schema checked; host evidence refused by console annotation tool
PS5 cross-build Linked ps5droid.elf with checksum-verified SDK v0.45, zlib 1.3.2 and upstream Clang/LLD 23.1.2
Formatting / documentation links Passed
Linux GCC / native differential test / Ubuntu Clang 18 configuration Awaiting CI execution
Actual PS5 execution Unverified; hardware report required

The fork workflow did not start any jobs because GitHub restricted runner access for the account. Its status does not represent executed build/test results; no CI pass is claimed.

Compatibility boundaries

The executable fixture is freestanding code compiled for LLVM's Android target and explicitly calls a gateway. It does not link bionic or establish unmodified Android startup, dynamic linking, TLS execution, raw-syscall interception or process isolation. The internal RPC engine does not provide Android Binder wire compatibility or ServiceManager.

The PS5 payload now records measurable observations and explicit unrecorded/not-run states. Firmware/loader provenance, video/input behavior and repeat-launch cleanup still require real hardware. The runtime manager continues to report the Android environment as blocked.

@aarvsn aarvsn closed this Oct 24, 2026
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.

2 participants