Android security tags, read closely by Lightrion

CVE-2023-40100 AI-generated analysis

platform/packages/modules/DnsResolver, DNS64 / NAT64 prefix discovery (Dns64Configuration, ResolverController)

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 (6 corrections). Verify against the commit before relying on it.

Makes Dns64Configuration reference counted (RefBase) and has the detached DNS64 prefix discovery thread capture a strong pointer (sp) to it instead of a raw this, so the object outlives the thread; ResolverController now owns it through android::sp.

Root cause

Dns64Configuration::startPrefixDiscovery (Dns64Configuration.cpp) spawns a std::thread whose lambda captured a raw `this` and used it (explicitly and implicitly) to access shouldContinueDiscovery, mGetNetworkContextCallback, recordDns64Config, mMutex and mCv. The thread is detached from the binder thread that requested discovery and retries with a backoff (maximum retransmission time 3600 s per index search). ResolverController held Dns64Configuration by value (`Dns64Configuration mDns64Configuration;`), so nothing tied the object's lifetime to the running thread. Per the commit message, the object can be destroyed during dnsresolver destruction while the discovery thread still uses it, which gives a use-after-free.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to November 2023 · Findings