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

Skip to content
Commit c276f8db authored by Yifan Hong's avatar Yifan Hong
Browse files

RpcServer::setupSocketServer prevent race

If two threads calls setup*Server, they may race.
Make sure one of them fail.

setupSocketServer calls into setupExternalServer to
double check that no other thread was setting up
server in the mean time to prevent TOCTOU.

This change also ensures that setupExternalServer is the
only place where mServer is set, and it is guarded by a
lock.

Test: binderRpcTest

Change-Id: Iadd3585b9cb4aa157bae072943f1bd47896a7a77
parent 00aeb769
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