summaryrefslogtreecommitdiff
path: root/debuggerd/handler/debuggerd_handler.cpp
diff options
context:
space:
mode:
authorP.Adarsh Reddy <quic_padarshr@quicinc.com>2020-07-21 03:09:28 +0530
committerTom Cherry <tomcherry@google.com>2020-07-23 15:57:52 +0000
commiteb568b55826b17ceaeaa242f74f99a98c701d1b8 (patch)
treeadb908ff5e5f70b3ad96dc92fe7c3640aae3c520 /debuggerd/handler/debuggerd_handler.cpp
parentcef328b5da34a5c829f80c9917a2b7b67d1bddcc (diff)
Ueventd: Fix a corner case in ReadUevent() that triggers duplicate firmware loading.
Presently, within ReadUevent(), true is returned for a successful case as well as for the case where we read an invalid uevent (overflowed buffer)where the Uevent object is not cleared, and the caller calls the callback (with the earlier stored uevent object),leading to duplicate firmware loading. Uevent uevent; while (ReadUevent(&uevent)) { if (callback(uevent) == ListenerAction::kStop) return; } Scenario: 1. Proper Uevent received and callback is called (firmware loading is triggered). 2. Overflowed uevent is received as part of the same ReadUevent session, ReadUevent() returns true, but the uevent object is not cleared and still has earlier event values. 3. Callback is called again, leading to duplicate firmware load. Handle it by adding explicit return codes to let the caller know if the uevent read is invalid, and the caller can ignore it and read further pending uevents. Bug: 161580785 Test: in AOSP Merged-In: I09e80052337fd1495b968dc02ecff5ceb683da18 Change-Id: I09e80052337fd1495b968dc02ecff5ceb683da18 (cherry picked from commit a86bf05a012e871c41b4676b0cc947b1baea194b)
Diffstat (limited to 'debuggerd/handler/debuggerd_handler.cpp')
0 files changed, 0 insertions, 0 deletions