summaryrefslogtreecommitdiff
path: root/libs/androidfw/ResourceTimer.cpp
diff options
context:
space:
mode:
author Eric Biggers <ebiggers@google.com> 2022-08-04 19:03:03 +0000
committer Eric Biggers <ebiggers@google.com> 2022-08-04 20:12:35 +0000
commitf0832139536abeb23c39f2b502278a348150c0e6 (patch)
tree0c352940db20eb6734d2d4724d6327fde1a4a39e /libs/androidfw/ResourceTimer.cpp
parent051989e657ad7ace01c2bf9c7776720eff743e3f (diff)
Fix deadlock in updatePasswordHistory()
One of the changes that commit bd3558749e71 ("Remove unused and insecure fallback to legacy password history hash") (http://ag/19331204) made was moving the call to updatePasswordHistory() into setLockCredentialWithSpLocked() so that the SyntheticPassword became available. Unfortunately, this causes a deadlock because the call to getRequestedPasswordHistoryLength() takes the DevicePolicyManagerService lock while the mSpManager lock is held, whereas normally these two locks are taken in the opposite order. Revert the problematic part of the change and go back to the original implementation where updatePasswordHistory() is called from onPostPasswordChanged(). Handle failure to compute the password hash (which should still never happen, but it becomes less obvious when the SP needs to be unwrapped) by logging an error message and not updating the password history. Test: atest LockscreenCredentialTest Test: atest com.android.server.locksettings Test: atest MixedDeviceOwnerTest#testSecurityLoggingWithSingleUser Bug: 241253969 Fixes: bd3558749e71 ("Remove unused and insecure fallback to legacy password history hash") Change-Id: I210407884a657bc2019d14f59ce56753b3cacd53
Diffstat (limited to 'libs/androidfw/ResourceTimer.cpp')
0 files changed, 0 insertions, 0 deletions