Repository navigation
fix: low-level crates (review P0-C) - #198
Merged
Merged
Conversation
- ictl-ax: an archive object that refers back to itself decodes as null; an archive whose shared objects would expand past 8 values a byte is refused (a few hundred bytes could ask for 2^60) - HID: points that aren't finite numbers, an unknown screen size and gesture durations that aren't finite are refused (NaN panicked in Duration::from_secs_f64 or tapped (0,0)); durations are capped at 60 s - the phone's log stream no longer asks for historical entries: the WDA runner took a past "Enabling Automation Mode" for a prompt now, app_logs stamped old lines as new; connecting to the accessibility service's port has a time limit - ictl-sign: the session and a new private key are locked down as soon as they are written; the scratch directory is removed by a guard (also when a caller's timeout drops the signing); packages are written to a temporary file and renamed into place - vt.rs (macOS): no `&mut` to the decoder's slot is held across the VideoToolbox calls whose callback writes it - Touch ID lock screen in any language: the prompt is known by its structure (SBCoverSheetWindow without the lock screen's date, two buttons), and its first button is tapped when the label isn't one we know Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l edges) - native reads (the screen, the front app) that time out in the tunnel drop it and read once more on a new one; a stuck tunnel was kept and timed out every read after it - a touch refused before anything was sent (InvalidInput) no longer tears the tunnel down - Touch ID prompt: the upper of the two buttons, not the first listed; the SBCoverSheetWindow name only counts on a window - archive: a budget used up exactly is enough; UIDs past usize aren't truncated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 25, 2026
Derrors
added a commit
that referenced
this pull request
Nov 25, 2026
…r) (#199) * test(maintenance): wait for the lock in the pending-journal test pending_journal_blocks_other_installs_after_lock_owner_dies took the shared lease right after dropping the exclusive one. Another test that spawns a process meanwhile holds a copy of the dropped descriptor in the child until it execs, and the lock with it, so the last shared_in failed now and then (CI on #188). With a thread spawning `true` in a loop it failed 37 times in 300. The test now retries while the lock is held (as once_free does for the other test in the file), and checks that the first refusal is for the pending journal, not for the lock: before, a held lock passed that assertion too. 0 failures in 300 under the same load. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * test(update): make the interrupted-worker test robust and say why it failed recovers_after_process_death_using_only_durable_records failed now and then (macOS CI on #198, Linux locally on 2026-11-24): the worker it starts ended without being killed, and its output went to /dev/null, so why was lost. - the worker's output goes to a file in the fixture directory and is shown when it isn't killed (a file, not a pipe: the fixture daemon it starts keeps the descriptor, and reading a pipe to its end would wait for that daemon) - Store::open is retried while the updater lock is held: another test that spawns a process meanwhile keeps a copy of a dropped lock's descriptor in the child until it execs, the race fixed for maintenance in the previous commit - the fixture daemon's spawn is retried on ETXTBSY (text file busy), the same race for the script just written, as archive.rs does for the real candidate Neither race reproduced on Linux (60 runs under a process-spawning thread, 40 full test binaries at 32 threads); the output will tell if it is another cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
P0, third batch, from the full review of
mainafter #195: the low-level crates.ictl-ax archive (H6): only a depth limit guarded the NSKeyedArchiver decoder, so objects sharing children level after level (2^60 values from a few hundred bytes) or referring back to themselves kept the daemon decoding. Now an object that refers back to one being decoded reads as null, and an archive may decode to at most 8 values per byte (at least 10,000), past which it is refused as malformed. Real archives stay far below: each reference takes at least a byte.
HID entry points (H7): a duration that isn't finite panicked in
Duration::from_secs_f64; aNaNpoint or a screen size of 0 was mapped to (0,0). Points, the screen size and durations that aren't finite (or a size ≤ 0) are refused withInvalidInput; durations are capped at 0–60 s (map_point,gesture_time).Log stream (review item 6):
log_streamasked for historical entries too. The WDA runner could take a past "Enabling Automation Mode" for a prompt now, andapp_logsstamps entries with their arrival time, so old lines showed as just logged. Nowoslog::flags::LIVE. Connecting to remoteAXService's port has a time limit too; a timeout there is the tunnel's (Timeout), not axauditd's (AxUnanswered).ictl-sign (H9): the account directory is 0700, so the 0644 files inside weren't open to other users. Still:
loginlocks the tree down after writing the session;sign_indoes so as soon as a new certificate's key is written, andsign_ipaagain even when signing failed;WorkDirguard, removed also when a caller's timeout drops the future;packandfrom_app_zipwrite a temporary file beside the target, fsync it and rename it into place;add_dirstreams files withio::copy.The daemon already ran signing in
spawn_blockingunderRESIGN_TIMEOUTand renamed into place itself, so the sync work and the missing network timeout were covered there.vt.rs (macOS) (H3):
Decoder::decodeheld&mut DecodedSlotacrossVTDecompressionSessionDecodeFrame/WaitForAsynchronousFrameswhileon_decodedmade another&mutto it. Now there are only short accesses through the raw pointer before and after the calls.Touch ID iPad in other languages (H8): only 使用密码 / Use Passcode / Enter Passcode were known, so in another language the prompt after swiping up was
CoverSheet::None: locked taken for unlocked, andlock_state_trustedset.cover_sheetnow also recognises the prompt by its structure:SBCoverSheetWindowwithoutlockscreen-date-viewand with exactly two buttons. The notification center has that window too, but with the date.use_passcode_button, when no label matches: the first of exactly two buttons on one vertical line, unless the lock screen's own identifiers are there (its "press Home to unlock" is a button, with a notification above it on the same line). Taking Cancel by mistake only goes back to the lock screen.Tests
1. Unit tests
cargo test --workspace --all-features --locked: 576 passed; clippy-D warnings;cargo fmt --checkfor all 11 packages;tests/check_regression_cases.py: 0 missinga_cycle_reads_as_null,an_archive_built_to_blow_up_is_refused,only_finite_points_and_durations_reach_the_phone,the_stream_is_live_only,a_failed_pack_leaves_the_old_package,the_scratch_directory_is_removed_when_dropped,a_touch_id_prompt_in_any_language(the three real Touch ID samples translated to German; the iPad lock screen, home screen, notification center and Settings samples not taken for it)vt.rsis compiled by the macOS CI job only (no darwin target here)2. Real-device regression
tests/device/run.pyon the iPhone: 16 calls, 0 failed3. Regression cases
4. Real-device proof
app_logsfills as beforeChecklist
🤖 Generated with Claude Code