Android security tags, read closely by Lightrion

CVE-2023-40091 AI-generated analysis

platform/frameworks/base, cmds/incidentd (IncidentService binder shell-command handling)

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

The SHELL_COMMAND_TRANSACTION handler in incidentd's IncidentService::onTransact now reads the in/out/err file descriptors with Parcel::readUniqueFileDescriptor (which dups them) and hands owned fds to fdopen via release(), instead of fdopen'ing fds still owned by the Parcel.

Root cause

In cmds/incidentd/src/IncidentService.cpp, IncidentService::onTransact handled SHELL_COMMAND_TRANSACTION by calling data.readFileDescriptor() three times and passing the returned fds directly to fdopen(). Per the commit message, readFileDescriptor does not provide ownership of the fds while fdopen needs ownership, so the fds should have been duped. The old code did not check whether the fd reads succeeded. It also declared a local `int err` fd that shadowed the outer `status_t err`, and later overwrote it with the result of command().

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to December 2023 · Findings