From 45b202513ba7440beaefbf9928f73fb6683dcfbd Mon Sep 17 00:00:00 2001 From: Fabien Sanglard Date: Wed, 18 Jan 2017 16:43:18 -0800 Subject: [PATCH] Fix security vulnerability Change-Id: I4c9ea3a3177131fa29d2561da71ef18bec3af108 Test: angler, marlin Bug: 32628763 --- services/surfaceflinger/SurfaceFlinger.cpp | 3 +-- services/surfaceflinger/SurfaceFlinger_hwc1.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index a10a8138e3..4e97321dbf 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2152,8 +2152,7 @@ void SurfaceFlinger::setTransactionState( if (s.client != NULL) { sp binder = IInterface::asBinder(s.client); if (binder != NULL) { - String16 desc(binder->getInterfaceDescriptor()); - if (desc == ISurfaceComposerClient::descriptor) { + if (binder->queryLocalInterface(ISurfaceComposerClient::descriptor) != NULL) { sp client( static_cast(s.client.get()) ); transactionFlags |= setClientStateLocked(client, s.state); } diff --git a/services/surfaceflinger/SurfaceFlinger_hwc1.cpp b/services/surfaceflinger/SurfaceFlinger_hwc1.cpp index 7f3b269f0e..8f6fd660e4 100644 --- a/services/surfaceflinger/SurfaceFlinger_hwc1.cpp +++ b/services/surfaceflinger/SurfaceFlinger_hwc1.cpp @@ -2168,8 +2168,7 @@ void SurfaceFlinger::setTransactionState( if (s.client != NULL) { sp binder = IInterface::asBinder(s.client); if (binder != NULL) { - String16 desc(binder->getInterfaceDescriptor()); - if (desc == ISurfaceComposerClient::descriptor) { + if (binder->queryLocalInterface(ISurfaceComposerClient::descriptor) != NULL) { sp client( static_cast(s.client.get()) ); transactionFlags |= setClientStateLocked(client, s.state); } -- 2.11.0