No description
Find a file
Janis Danisevskis 66784c4628 Keystore 2.0: Poll on DB locked.
SQLite2 seems to hold a shared mutex while running the busy handler when
waiting for the database file to become available. This makes it
impossible to successfully recover from a locked database when the
transaction holding the device busy is in the same process on a
different connection. As a result the busy hander has to time out and
fail in order to make progress.

This patch replaces the default busy handler with one that times out
immediately. In addition all database accesses have been moved into
retry loops that handle the busy error which can occur at any time, not
only during begin or commit of a transaction. This assures that no
sqlite3 internal mutexes are held while waiting for the database to
become available.

The database interface had to change slightly to assure that all
database manipulations can be replayed and not data is lost.

A test has been added that makes sure that the correct error is caught,
and another test was added that produces a lot of concurrent database
manipulations and would easily trigger database busy errors.

Test: keystore2_test
Change-Id: I8ce3e3159b2356ace2b9f0ebdf074bbabc6612af
2021-02-08 09:11:28 -08:00
fsverity_init Split fsverity_init in multiple phases. 2020-12-03 10:03:17 +01:00
identity Specify version for aidl_interface explicitly 2021-01-27 07:38:28 +09:00
keystore Merge RQ1A.210105.003 to aosp-master - DO NOT MERGE 2021-01-06 05:08:26 +00:00
keystore-engine Allow for input_data on finish. 2019-11-14 16:43:12 -07:00
keystore2 Keystore 2.0: Poll on DB locked. 2021-02-08 09:11:28 -08:00
ondevice-signing On-device signing binary. 2020-12-08 15:12:59 +01:00
provisioner Add provisioner CLI and its interface. 2020-11-12 15:21:12 +00:00
.clang-format Add PREUPLOAD to require clang-format. 2017-12-04 17:06:49 -07:00
.gitignore Add .gitignore. 2020-11-24 09:59:17 -08:00
Android.bp Move keystore to Android.bp. 2017-10-23 16:03:59 -06:00
METADATA Add METADATA to system/security: Apache2+BSD=NOTICE 2020-05-04 13:15:58 -07:00
MODULE_LICENSE_APACHE2 Add NOTICE and MODULE_LICENSE_ files. 2015-11-02 09:13:29 -08:00
NOTICE Add NOTICE and MODULE_LICENSE_ files. 2015-11-02 09:13:29 -08:00
OWNERS Remove myself from OWNERS 2021-01-26 17:21:17 +00:00
PREUPLOAD.cfg Update rustfmt options 2020-08-19 15:19:21 +00:00
rustfmt.toml Enable rustfmt for system/security 2020-06-23 15:50:23 +02:00