Test TOCTOU in VTS CompilationCachingTests.
Two tests are added into VTS: 1. The TOCTOU test, for a fixed number of iterations. We try to attack the driver by replacing the model cache with another cache entry from a similar model while the driver is saving to or preparing from cache, and see if the driver crashes or falsely prepares an unexpected model (by checking the execution result). Either of the following results are acceptable * Fails -> the driver detects this corruption. * Succeeds and produces correct execution result -> the corruption happens before saving to cache or after preparing from cache. Due to the racy nature, this test is probabilistic and we run it several times. 2. Similar to the TOCTOU test but replace the content between compile-to-cache and compile-from-cache (once only). Additionally, remove tmp cache directory if test succeeds. Bug: 123433989 Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can read and write cache entries Test: Check /data/local/tmp and confirm that * dirs are preserved on failure * dirs are removed on success Change-Id: Ie04fa905f465c3775979f0ca74359d185dcacea9 Merged-In: Ie04fa905f465c3775979f0ca74359d185dcacea9 (cherry picked from commit a44e130a)
Loading
Please register or sign in to comment