From 2d8a2432e04234d9edbb3b099f9bbbaa36ad4843 Mon Sep 17 00:00:00 2001 From: Fabien Sanglard Date: Tue, 8 Nov 2016 15:31:32 -0800 Subject: [PATCH] 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 --- libs/gui/BufferQueueConsumer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp index d62eaf716f..bc6f3f012a 100644 --- a/libs/gui/BufferQueueConsumer.cpp +++ b/libs/gui/BufferQueueConsumer.cpp @@ -517,6 +517,7 @@ status_t BufferQueueConsumer::setTransformHint(uint32_t hint) { } sp BufferQueueConsumer::getSidebandStream() const { + Mutex::Autolock lock(mCore->mMutex); return mCore->mSidebandStream; } -- 2.11.0