Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92586c12 authored by Hai Zhang's avatar Hai Zhang
Browse files

Fix deadlock in AccessCheckDelegateImpl.

We shouldn't call into packages when holding our own lock. We can simply
temporarily release our lock when we need to call into packages to get
the UID.

We only call into packages when needed because there's a non-trivial
performance cost if we do that.

It's also okay for us to temporarily release our lock in this case
because even if mOverridePermissionStates changes while we aren't
holding the lock, we'll still return a valid permission check result, as
we don't have atomicity guarantee between shell identity and override
permission states which are two APIs, and we can accept the small
one-time performance penalty of needlessly fetching the UID in the
unlikely case there was an override permission state that's now gone.

Fixes: 429911389
Flag: EXEMPT bug fix
Test: presubmit
Change-Id: I5b620285741f101ea933b60be88d4b8808566a74
parent e8402bc4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment