Commit graph

1981 commits

Author SHA1 Message Date
Janis Danisevskis
e583877904 [automerger skipped] Fix keystore wifi concurrency issue.
am: 1d898d107c -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 1849841b48 is in history

Change-Id: Iba35334932fe563e564f5c607503c6786a41cc6a
2019-05-08 15:34:21 -07:00
Janis Danisevskis
5da44d7e1b [automerger skipped] Fix keystore wifi concurrency issue. am: 1849841b48 -s ours am: 2bfc0d9d73 -s ours am: bf5f2ddd1e -s ours
am: 27ba2054c0 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 54fcc9954b is in history

Change-Id: I63aa01522e358ee62f94fa8aa4ae2f881b6432ee
2019-05-08 12:42:30 -07:00
Janis Danisevskis
f97993f5f6 [automerger skipped] Fix keystore wifi concurrency issue. am: 1849841b48 -s ours am: 2bfc0d9d73 -s ours am: bf5f2ddd1e -s ours
am: 27ba2054c0 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 54fcc9954b is in history

Change-Id: I2e4fac92b440653010e32a9d31044de8edc4146e
2019-05-08 12:41:26 -07:00
Janis Danisevskis
27ba2054c0 [automerger skipped] Fix keystore wifi concurrency issue. am: 1849841b48 -s ours am: 2bfc0d9d73 -s ours
am: bf5f2ddd1e -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 54fcc9954b is in history

Change-Id: Ibd73fefb27ced4e992d2298845c5ad2d498a6b04
2019-05-08 12:14:32 -07:00
Janis Danisevskis
bf5f2ddd1e [automerger skipped] Fix keystore wifi concurrency issue. am: 1849841b48 -s ours
am: 2bfc0d9d73 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 54fcc9954b is in history

Change-Id: Ia55834ce7f458033a41868b0aca1247375cad0f9
2019-05-08 12:04:26 -07:00
Janis Danisevskis
2bfc0d9d73 [automerger skipped] Fix keystore wifi concurrency issue.
am: 1849841b48 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 54fcc9954b is in history

Change-Id: If416ad7de274420185e1cdc497399560f99bcbad
2019-05-08 11:44:53 -07:00
Janis Danisevskis
1849841b48 Fix keystore wifi concurrency issue.
Keystore was conceptually single threaded. Even with the introduction of
Keymaster workers it was always assumed that the service dispatcher
thread was single threaded. The wifi keystore service, however, calls
into the keystore service concurrently.

This patch adds a lock around all keystore service entry points to make
sure all dispatcher executions are serialised despite being called from
both the binder and hwbinder service thread.

Bug: 128810613
Bug: 129145334
Bug: 128774635
Bug: 130045583
Bug: 131622568
Test: Regressions tested with Keystore CTS test suite.
Merged-In: I8c5602d2c2cb1dd9423df713037e99b247cee71f
Change-Id: I8c5602d2c2cb1dd9423df713037e99b247cee71f
(cherry picked from commit 54fcc9954b)
2019-05-08 15:44:00 +00:00
Janis Danisevskis
e3e0647909 [automerger skipped] Fix keystore wifi concurrency issue. am: 54fcc9954b -s ours am: e7f2c8fb9f -s ours
am: 15d53c8525 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 4ea6d7a447 is in history

Change-Id: I5e51123c7f3363f7ee4dfb2468e51b387dc288e1
2019-05-07 20:30:04 -07:00
Janis Danisevskis
3577aff831 [automerger skipped] Fix keystore wifi concurrency issue. am: 54fcc9954b -s ours am: e7f2c8fb9f -s ours
am: 15d53c8525 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 4ea6d7a447 is in history

Change-Id: I7ba2977ffb0a503c0d133469a75b995901e78782
2019-05-07 20:28:53 -07:00
Janis Danisevskis
5179ea42d0 [automerger skipped] Fix keystore wifi concurrency issue. am: 4ea6d7a447 -s ours
am: cfbf8a4125 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 b50236a08b is in history

Change-Id: Ib88c3a21e3950fc32f9bc7380bcb9d23b6c605e3
2019-05-07 20:21:05 -07:00
Janis Danisevskis
d669274b14 [automerger skipped] Fix keystore wifi concurrency issue. am: 4ea6d7a447 -s ours
am: cfbf8a4125 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 b50236a08b is in history

Change-Id: I8b1dfa0c89f996bd4c567cd9390812f4ea1d2ba4
2019-05-07 20:18:27 -07:00
Janis Danisevskis
15d53c8525 [automerger skipped] Fix keystore wifi concurrency issue. am: 54fcc9954b -s ours
am: e7f2c8fb9f -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 4ea6d7a447 is in history

Change-Id: Ib08d01e09c7b55f95d10117267bf4456d811d1ee
2019-05-07 18:32:04 -07:00
Janis Danisevskis
e7f2c8fb9f [automerger skipped] Fix keystore wifi concurrency issue.
am: 54fcc9954b -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 4ea6d7a447 is in history

Change-Id: If834903f0f0266fd6b5713a4086742f356296769
2019-05-07 18:27:06 -07:00
Janis Danisevskis
cfbf8a4125 [automerger skipped] Fix keystore wifi concurrency issue.
am: 4ea6d7a447 -s ours
am skip reason: change_id I8c5602d2c2cb1dd9423df713037e99b247cee71f with SHA1 b50236a08b is in history

Change-Id: I5e6537d889463dc170fdb1ab5ebf05004422de34
2019-05-07 18:21:58 -07:00
android-build-team Robot
07fa223f78 Snap for 5450365 from 2901ff5e4e to pi-platform-release
Change-Id: I67bd0e7bc849fcaca90e952547ad9d4d54e05ea6
2019-05-07 21:47:40 +00:00
Janis Danisevskis
06b96aa1ea Merge changes from topic "verbose-vendor-logging" am: b6069dcb3c
am: bc57549c90

Change-Id: Ifb53b5e715b1e66a0af4afee54be9133e4c3b198
2019-05-06 17:18:48 -07:00
Janis Danisevskis
7499de11cc [automerger skipped] Clearly indicate vendor errors from keymaster in logcat am: 37896101ea
am: 4378c8ffec -s ours
am skip reason: change_id Ifceece542d6f3536ad87d053145c7aa8dd6d6603 with SHA1 a359c67241 is in history

Change-Id: Icc67744554d5a68e221dce24a3cdcb0e0ffd66c4
2019-05-06 17:18:39 -07:00
Janis Danisevskis
bc57549c90 Merge changes from topic "verbose-vendor-logging"
am: b6069dcb3c

Change-Id: I4730f8e7ace90a09ad4247d9d338e02cf7c9e917
2019-05-06 16:47:26 -07:00
Janis Danisevskis
4378c8ffec Clearly indicate vendor errors from keymaster in logcat
am: 37896101ea

Change-Id: I2ab9eb128fea6ee8c6c65878c32de32450be0c7d
2019-05-06 16:47:11 -07:00
Treehugger Robot
b6069dcb3c Merge changes from topic "verbose-vendor-logging"
* changes:
  Fix grants get lost on key upgrade
  Clearly indicate vendor errors from keymaster in logcat
2019-05-06 23:30:10 +00:00
Janis Danisevskis
6a0d998380 Fix grants get lost on key upgrade
The upgrade routine used to call KeyStore->del which purges the given
key blob from the keystore including all existing grants.
With this patch, upgrade only calls Keymaster::delete on the keyblobs
without purging it from the keystore. Also it only calls
Keymaster::delete once the upgrade key was successfully written to disk.

This patch also calls fsync on the directory containing keyblobs to
narrow the window in which keyblob may be lost due to power loss.

Bug: 110450771
Test: Upgrade path tested by manually creating a key, bumping the
      patchlevel, using the key subsequently and inspecting the logs.
Change-Id: I89241b5d4033b270733ff61838ab9244fce28c60
2019-05-03 16:19:06 -07:00
Janis Danisevskis
37896101ea Clearly indicate vendor errors from keymaster in logcat
This patch addes verbose logging whenever an error code in the vendor
error code range is returned by keymaster.

Bug: 123562864
Test: atest android.keystore.cts
Merged-In: Ifceece542d6f3536ad87d053145c7aa8dd6d6603
Change-Id: Ifceece542d6f3536ad87d053145c7aa8dd6d6603
2019-05-03 16:18:45 -07:00
Janis Danisevskis
54fcc9954b Fix keystore wifi concurrency issue.
Keystore was conceptually single threaded. Even with the introduction of
Keymaster workers it was always assumed that the service dispatcher
thread was single threaded. The wifi keystore service, however, calls
into the keystore service concurrently.

This patch adds a lock around all keystore service entry points to make
sure all dispatcher executions are serialised despite being called from
both the binder and hwbinder service thread.

Bug: 128810613
Bug: 129145334
Bug: 128774635
Bug: 130045583
Bug: 131622568
Test: Regressions tested with Keystore CTS test suite.
Merged-In: I8c5602d2c2cb1dd9423df713037e99b247cee71f
Change-Id: I8c5602d2c2cb1dd9423df713037e99b247cee71f
2019-05-03 08:58:54 -07:00
Janis Danisevskis
1d898d107c Fix keystore wifi concurrency issue.
Keystore was conceptually single threaded. Even with the introduction of
Keymaster workers it was always assumed that the service dispatcher
thread was single threaded. The wifi keystore service, however, calls
into the keystore service concurrently.

This patch adds a lock around all keystore service entry points to make
sure all dispatcher executions are serialised despite being called from
both the binder and hwbinder service thread.

Bug: 128810613
Bug: 129145334
Bug: 128774635
Bug: 130045583
Bug: 131622568
Test: Regressions tested with Keystore CTS test suite.
Merged-In: I8c5602d2c2cb1dd9423df713037e99b247cee71f
Change-Id: I8c5602d2c2cb1dd9423df713037e99b247cee71f
2019-05-03 08:58:07 -07:00
android-build-team Robot
c07ec6d90d Merge cherrypicks of [7316389, 7315812, 7315813, 7316457, 7316055, 7315736, 7316390, 7316458, 7316459, 7316460, 7316561, 7316562, 7316563, 7316564, 7316565, 7316566, 7316567, 7316391, 7315814, 7316548] into pi-qpr3-b-release
Change-Id: Iaeeba5247525b45f8eafa378de4cb83f147454df
2019-05-03 10:27:29 +00:00
Adam Seaton
15e148f11f [DO NOT MERGE] Revert "Give some permissions to bluetooth"
Bug:117993149
This reverts commit 82640d48ff.

Reason for revert: removing this from May QPR & pi-dev.

Change-Id: Iba04236d0c662f6381c6d51f336ffa70510cb62f
(cherry picked from commit ea91b947820e41fb5d9f5b5f0a8ae9ae9e5c1794)
2019-05-03 10:23:57 +00:00
Adam Seaton
b7bce4e1ee [DO NOT MERGE] Revert "Fix KeyStoreClientImpl::doesKeyExist to return correct result"
Bug:117993149
This reverts commit cb77797d66.

Reason for revert: removing this from May QPR & pi-dev.

Change-Id: I55eb358bd8ea8c82521ac07dbf37f4895fe3e8e9
(cherry picked from commit fab0e5d8e06fe23864c4f89df89271f8a55715a8)
2019-05-03 10:23:53 +00:00
Adam Seaton
f3860d7e76 [DO NOT MERGE] Revert "Grant VTS tests all permissions in keystore on userdebug/eng"
Bug:117993149
This reverts commit cfe00de661.

Reason for revert: removing this from May QPR & pi-dev.

Change-Id: Id3d5381cedcbbb47a1014bdf521e1a1083aa2724
(cherry picked from commit e7a4f584dfb8558ab22e5e7620f00f515f04c4e0)
2019-05-03 10:23:48 +00:00
Janis Danisevskis
4ea6d7a447 Fix keystore wifi concurrency issue.
Keystore was conceptually single threaded. Even with the introduction of
Keymaster workers it was always assumed that the service dispatcher
thread was single threaded. The wifi keystore service, however, calls
into the keystore service concurrently.

This patch adds a lock around all keystore service entry points to make
sure all dispatcher executions are serialised despite being called from
both the binder and hwbinder service thread.

Bug: 128810613
Bug: 129145334
Bug: 128774635
Bug: 130045583
Bug: 131622568
Test: Regressions tested with Keystore CTS test suite.
Merged-In: I8c5602d2c2cb1dd9423df713037e99b247cee71f
Change-Id: I8c5602d2c2cb1dd9423df713037e99b247cee71f
2019-05-01 14:16:17 -07:00
Janis Danisevskis
55570066c7 Merge "Make keystore more noisy on diagnosing corrupted key blobs." am: 939ef15ed5
am: fb27742c63

Change-Id: Ie402dc09899934d85e5eece1759a11eae7301c1f
2019-04-11 19:45:46 -07:00
Janis Danisevskis
fb27742c63 Merge "Make keystore more noisy on diagnosing corrupted key blobs."
am: 939ef15ed5

Change-Id: I80205eb37ad4c2886d8174f110ca204be947d5cf
2019-04-11 19:40:41 -07:00
Treehugger Robot
939ef15ed5 Merge "Make keystore more noisy on diagnosing corrupted key blobs." 2019-04-12 02:34:38 +00:00
Janis Danisevskis
56ec439a28 Make keystore more noisy on diagnosing corrupted key blobs.
Bug: 130163310
Test: Added logging, no functional changes.
Change-Id: I69a70eff2db4069ff479b2a397cb7b083f97d922
2019-04-11 13:28:15 -07:00
Max Bires
2336ca0bba Merge "Adding thread safety to proto uploader" am: 72a0ffe9c1 am: 4002636834
am: cc066fcd86

Change-Id: Ia5bc9bfaf3da6a8819bd549d1c08300a260c695d
2019-03-25 22:27:05 -07:00
Max Bires
cc066fcd86 Merge "Adding thread safety to proto uploader" am: 72a0ffe9c1
am: 4002636834

Change-Id: Ic8be0cb9b49ae27e03111a3efd8f07160ade3243
2019-03-25 22:23:02 -07:00
Max Bires
4002636834 Merge "Adding thread safety to proto uploader"
am: 72a0ffe9c1

Change-Id: I3fbb545b17abea8cc5a11bbabbd224c573a25040
2019-03-25 22:19:02 -07:00
Treehugger Robot
72a0ffe9c1 Merge "Adding thread safety to proto uploader" 2019-03-26 05:07:50 +00:00
Max Bires
772a8de356 Adding thread safety to proto uploader
Due to lack of thread safety it seems that protobuf values were
occasionally getting deleted during parsing, causing ubsan to register
an error down the line in the protobuf library.

Bug: 128991260
Bug: 128810613
Test: atest cts/tests/tests/keystore/src/android/keystore/cts
Change-Id: Iee7ec6195e1e0aa4b28a7484737f984ed389a75e
2019-03-25 17:00:29 -07:00
Janis Danisevskis
d7c3ea15ee Merge "Fix keystore wifi concurrency issue." am: dece12434d am: fe8fb1fc2c
am: 9a9794408c

Change-Id: Ic9c42a6876f056f70d25751c9feb2e650f753ac9
2019-03-25 15:37:43 -07:00
Janis Danisevskis
9a9794408c Merge "Fix keystore wifi concurrency issue." am: dece12434d
am: fe8fb1fc2c

Change-Id: I401862d72c4af2178656b53c4ceda3e9bb1f9ed1
2019-03-25 15:33:30 -07:00
Janis Danisevskis
fe8fb1fc2c Merge "Fix keystore wifi concurrency issue."
am: dece12434d

Change-Id: I96a65c120fa6fe54112400687ee7e9a7578672e8
2019-03-25 15:28:48 -07:00
Janis Danisevskis
58f3820418 Merge "ConfirmationUI: Invocation native test" 2019-03-25 22:15:23 +00:00
Janis Danisevskis
dece12434d Merge "Fix keystore wifi concurrency issue." 2019-03-25 22:11:14 +00:00
Janis Danisevskis
b50236a08b Fix keystore wifi concurrency issue.
Keystore was conceptually single threaded. Even with the introduction of
Keymaster workers it was always assumed that the service dispatcher
thread was single threaded. The wifi keystore service, however, calls
into the keystore service concurrently.

This patch adds a lock around all keystore service entry points to make
sure all dispatcher executions are serialised despite being called from
both the binder and hwbinder service thread.

Bug: 128810613
Bug: 129145334
Bug: 128774635
Test: Regressions tested with Keystore CTS test suite.
Change-Id: I8c5602d2c2cb1dd9423df713037e99b247cee71f
2019-03-25 13:02:40 -07:00
Janis Danisevskis
5c6af75274 ConfirmationUI: Invocation native test
This test tries to invoke the ConfirmationUI and cancels it after 2
seconds. It is intended as a pre commit canary for the CanfirmationUI
feature on supporting phones.

Bug: 128993063
Test: Yes it is
Change-Id: I20f7e1b400bef08e0496bf656f65719006f025eb
2019-03-21 14:50:41 -07:00
Janis Danisevskis
09f8cb156d Merge "Clearly indicate vendor errors from keymaster in logcat" 2019-03-20 16:15:09 +00:00
Janis Danisevskis
a359c67241 Clearly indicate vendor errors from keymaster in logcat
This patch addes verbose logging whenever an error code in the vendor
error code range is returned by keymaster.

Bug: 123562864
Test: atest android.keystore.cts
Change-Id: Ifceece542d6f3536ad87d053145c7aa8dd6d6603
2019-03-20 16:14:17 +00:00
Janis Danisevskis
8196b8c937 Add logging around access calls.
We saw evidence, that the keystore exist method may be flaky. This
patch adds logging around the access calls used to check for key blobs.
Also adds a retry loop in case access return EAGAIN. (Although access
should not return EAGAIN).

Bug: 128318105
Test: Only logging added.
Change-Id: Ib07396f590c2f58e227f85869ada8c6d6dd46df4
2019-03-15 15:01:33 -07:00
Janis Danisevskis
e534419c71 Merge "keystore_backend_binder: fix misinterpretation of getKeyCharacteristics return value." am: 2cd64544e0 am: fcd8b15f20
am: fe8e03bc80

Change-Id: Ica75282d96b881fce0272e12cb356999132c7987
2019-03-13 17:17:06 -07:00
Janis Danisevskis
fe8e03bc80 Merge "keystore_backend_binder: fix misinterpretation of getKeyCharacteristics return value." am: 2cd64544e0
am: fcd8b15f20

Change-Id: I9eb61644485a7cc66407d4f2faf405e01b309511
2019-03-13 17:13:04 -07:00