Skip to content
Commit a62d6384 authored by Zoltan Gepesz's avatar Zoltan Gepesz
Browse files

[PAuth] Fix flaky pauth tests

Pauth tests are susceptible to failure due to hash collisions (approximately 1 in every 2^7 runs for each PAuth operation,
depending on PAC field length).
To reduce the probability of failure if a hash collision is detected, a failing test is either:
- repeated up to N times with the keys of the process reset by prctl(PR_PAC_RESET_KEYS,0,0,0,0)
- repeated with different input (up to N times, with incremented input).

Where N is set by the test_count variable, currently 4.

The following changes are made:
- Tests in PAuthTest::Signing and PAuthTestData::Signing are repeated with incremented operand.
- Tests in PAuthDeathTest::SignFailure are repeated up to N times, and the keys of the process are reset on every collision
detected.
- The test in PAuthTest::KeyChange is repeated up to N times.

The expected probability of failure is thus expected to be reduced approximately to 1 in every 2^28 ( 2^(7N) ) runs for
each of the tests.

Change-Id: Id38e3c4ea8e94602f2e728731b035832c71270be
parent 868040b8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment