summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/service
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2016-12-01 15:28:29 -0800
committerSean McCreary <mccreary@mcwest.org>2017-03-22 12:36:15 -0600
commitdac1444e4926f94d8d9ac6b6a098ac101ce4a7be (patch)
treef5ce31efebcd13cd9e32dced444b7d2b63d3e727 /services/audiopolicy/service
parent0574c56e88e96d33c923a8f54364ac0bf3dc5a91 (diff)
downloadframeworks_av-dac1444e4926f94d8d9ac6b6a098ac101ce4a7be.zip
frameworks_av-dac1444e4926f94d8d9ac6b6a098ac101ce4a7be.tar.gz
frameworks_av-dac1444e4926f94d8d9ac6b6a098ac101ce4a7be.tar.bz2
DO NOT MERGE - improve audio effect framwework thread safety
- Reorganize handle effect creation code to make sure the effect engine is created with both thread and effect chain mutex held. - Reorganize handle disconnect code to make sure the effect engine is released with both thread and effect chain mutex held. - Protect IEffect interface methods in EffectHande with a Mutex. - Only pin effect if the session was acquired first. - Do not use strong pointer to EffectModule in EffectHandles: only the EffectChain has a single strong reference to the EffectModule. Bug: 32707507 CVE-2017-0479 CVE-2017-0480 CVE-2017-0499 Change-Id: Ia1098cba2cd32cc2d1c9dfdff4adc2388dfed80e (cherry picked from commit b378b73dd7480b584340b8028802c9ca2d625123) (cherry picked from commit 22e26d8ee73488c58ba3e7928e5da155151abfd0 with backport by <sultanxda@gmail.com>)
Diffstat (limited to 'services/audiopolicy/service')
-rw-r--r--services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
index b23c35e..45b3bb0 100644
--- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
@@ -417,7 +417,6 @@ void AudioPolicyService::releaseInput(audio_io_handle_t input,
sp<AudioPolicyEffects>audioPolicyEffects;
{
Mutex::Autolock _l(mLock);
- mAudioPolicyManager->releaseInput(input, session);
audioPolicyEffects = mAudioPolicyEffects;
}
if (audioPolicyEffects != 0) {
@@ -427,6 +426,10 @@ void AudioPolicyService::releaseInput(audio_io_handle_t input,
ALOGW("Failed to release effects on input %d", input);
}
}
+ {
+ Mutex::Autolock _l(mLock);
+ mAudioPolicyManager->releaseInput(input, session);
+ }
}
status_t AudioPolicyService::initStreamVolume(audio_stream_type_t stream,