Skip to content
Race condition Write-up Advanced

(CVE-2024-26923) Android AF_UNIX Garbage Collector Race Condition Leading to Use-After-Free

A race condition in the Linux kernel's AF_UNIX garbage collector leaves a dangling pointer in the gc_inflight_list, which can be exploited for local privilege escalation on Android. An attacker with local access could potentially gain elevated privileges.

starlabs.sg

Published on starlabs.sg

A Unix domain socket (UDS, or IPC socket) is a data communications endpoint for exchanging data between processes executing on the same host. Identified by address family AFUNIX, it is a fundamental component of nix operating systems and is heavily used in Android for inter-process communication.

The author, on starlabs.sg

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a missing or improper synchronisation in the AF_UNIX garbage collector allows a use-after-free when the gc_inflight_list is accessed concurrently.

Impact

An attacker with local access could exploit this to achieve local privilege escalation, potentially gaining high confidentiality, integrity, and availability impact.

What the attacker needed

Local access to the device; ability to run code in an app context

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A race condition happens when two parts of a program try to use the same thing at the same time without proper coordination, causing unexpected behaviour. Here, the garbage collector for Unix sockets can leave a pointer to memory that has already been freed, and an attacker who can run code on the device might use that to gain higher privileges.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.