summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Sanglard <sanglardf@google.com>2016-11-08 15:31:32 -0800
committergitbuildkicker <android-build@google.com>2016-11-30 10:18:55 -0800
commit70f9b5a1d98502b5c240efd089821bbc167ade1a (patch)
treeb768a7a3e0e5f6a3b2302fd2b2e556b406b7d565
parente5543013be3ac71f74c5acac358eba0a5e460401 (diff)
downloadnative-70f9b5a1d98502b5c240efd089821bbc167ade1a.tar.gz
Fix SF security vulnerability: 32660278
Because of lack of mutex lock when get mSidebandStream, if one thread getSidebandStream, another thread setSidebandStream frequently, an UAF will be triggered. Bug: 32660278 Test: Marlin device with poc Change-Id: Idbcf0976ce2db682d0f13455105c45a5c7481a45 (cherry picked from commit 2d8a2432e04234d9edbb3b099f9bbbaa36ad4843)
-rw-r--r--libs/gui/BufferQueueConsumer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp
index 525938e7f2..96f7829233 100644
--- a/libs/gui/BufferQueueConsumer.cpp
+++ b/libs/gui/BufferQueueConsumer.cpp
@@ -714,6 +714,7 @@ status_t BufferQueueConsumer::setTransformHint(uint32_t hint) {
}
sp<NativeHandle> BufferQueueConsumer::getSidebandStream() const {
+ Mutex::Autolock lock(mCore->mMutex);
return mCore->mSidebandStream;
}