Skip to content

soc: apple: sep: Initialise blank host-state store files again, and run the SEP KUnit suites in CI - #1193

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
fix/sep-host-store-blank-files
Nov 8, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
fix/sep-host-store-blank-files

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

apple_sep_host_store has failed 4 of its 19 tests on integration/aurora since the 7.3 merge. Every Touch ID series since then has reported the same 4 failures as pre-existing (#904, #1087, #1134, #1143: "4 = base host_store"). CI never noticed because the SEP checks compile the KUnit tests but never run them.

Cause (code, not tests)

Store::from_file() starts with an early check, if size < STORE_SIZE { refuse(Damage::Size) }. 387f76c removed that check. c73c18c ("Initialise an empty host-state store file again") depends on it being gone: a short file has to reach the Damage::Size path, where describe() tells a blank file (left by an interrupted creation) from damaged state. The 7.3 aurora-wip merge c20b9d9 brought the check back, and 1c10889 ("Keep the WIP store-size guard") kept it. Now every blank short file is refused before describe() runs. On a real machine that means one interrupted store creation turns Touch ID off on every boot, until someone deletes /var/lib/aurora-sep-host-state.bin by hand. The four failing tests assert exactly this behaviour, and c73c18c's commit message explains why it is wanted. The tests are right.

Fix

  • soc: apple: sep: Initialise blank host-state store files again: removes the check. A short file is still read only through describe(). A file with any non-zero byte is still refused and not written to, which the existing tests for truncated stores and non-blank short files cover. No test was changed.
  • soc: apple: sep: Run the KUnit suites in CI: adds drivers/soc/apple/sep.kunitconfig (the config the lanes already use) and a kunit job in sep-source.yml that runs apple_sep* on arm64 QEMU with the layout-corrected bindgen. The job takes 6 to 10 minutes.

KUnit, arm64 QEMU, from this PR's own CI

Before. CI commit only, on integration 36d9198 (run 42445486052):

# apple_sep_host_store: pass:15 fail:4 skip:0 total:19
Testing complete. Ran 171 tests: passed: 167, failed: 4
Failures: apple_sep_host_store.existing_empty_and_zero_files_are_initialised, apple_sep_host_store.a_created_flag_keeps_valid_records_and_retries_blank_files, apple_sep_host_store.interrupted_creation_is_retried, apple_sep_host_store.blank_creation_is_distinguished_from_damaged_state

After. With the fix (run 42446252716):

============== [PASSED] apple_sep_host_store ===============
Testing complete. Ran 171 tests: passed: 171

checkpatch --strict: 0 errors and 0 warnings on the fix. The CI commit gets the usual MAINTAINERS warning for a new file. No hardware needed. Open PRs #583 and #962 touch other lines of store.rs and still apply.

🤖 Generated with Claude Code

The SEP source checks build the driver with APPLE_SEP_KUNIT_TEST but
never run the tests, so a failing suite does not show up on a pull
request. apple_sep_host_store has been failing on integration/aurora
since the 7.3 merge, and every Touch ID series since has reported the
same four failures as "pre-existing".

Add the kunitconfig the lanes already use for the apple_sep suites and
a job that runs them on arm64 QEMU with the layout-corrected bindgen.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
A creation of the host-state store that is interrupted before its
superblock is written leaves an empty or all-zero file shorter than the
store. Commit c73c18c ("soc: apple: sep: Initialise an empty
host-state store file again") made from_file() initialise such a file
again, since it holds no state, and refuse only files with other
contents. That relies on a short file reaching the Damage::Size path,
where describe() tells blank files from damaged ones.

The 7.3 merge into aurora-wip brought back the early size guard from the
older refuse-everything version, and commit 1c10889 ("merge: adapt
the retained store guard and DWC3 fixture to 7.3") kept it. The guard
refuses every file shorter than the store before describe() runs, so a
blank short file is refused again: Touch ID stays off on every boot
until someone deletes /var/lib/aurora-sep-host-state.bin by hand. This
is what the four failing apple_sep_host_store tests check.

Drop the guard. A short file is still read only through describe(), and
one with any non-zero byte is still refused without being written to,
as the tests for truncated stores and non-blank short files check.

Fixes: 1c10889 ("merge: adapt the retained store guard and DWC3 fixture to 7.3")
Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 8, 2026 04:25
@RyanTheTide
RyanTheTide merged commit fc71561 into integration/aurora Nov 8, 2026
4 checks passed
@RyanTheTide
RyanTheTide deleted the fix/sep-host-store-blank-files branch November 8, 2026 04:25
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