Android security tags, read closely by Lightrion

CVE-2023-40115 AI-generated analysis

platform/packages/modules/StatsD, statsd native service (StatsService pushed-event reader thread)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (7 corrections). Verify against the commit before relying on it.

Replaces the detached log-reader thread spawned in the StatsService constructor with a class-member std::thread. The thread is told to stop (an atomic flag plus a wake-up event pushed into the queue) and joined in the StatsService destructor, so readLogs() can no longer run against a destroyed StatsService.

Root cause

In statsd/src/StatsService.cpp the constructor created `std::thread pushedEventThread([this] { readLogs(); })` and immediately called `detach()`. readLogs() loops forever: it calls `mEventQueue->waitPop()` and then passes the event on for processing, so it uses `this` and its members for as long as the thread runs. The destructor was empty and nothing tied the thread to the StatsService object. So, as the commit message puts it, pushedEventThread references class members after detaching, and a destroyed StatsService could still be accessed by the running thread.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to November 2023 · Findings