Race condition in Fonts (CVE-2026-106238)
A race condition in the browser process's FontUniqueNameLookup on Android allows a use-after-free when one thread appends to a vector while another iterates and clears it. An attacker could trigger a browser process crash, potentially leading to further exploitation.
c6eed09fc8b174b0f3eebedcceb1e792 Follow
Originally disclosed on Chrome VRP
- Fix shipped in 7 months
Cross-thread race on FontUniqueNameLookup::pending_callbacks_ leads to browser process use-after-free
Summary
The browser-process singleton content::FontUniqueNameLookup on Android accesses its pending_callbacks_ vector from two different threads without synchronization. A Mojo service sequence calls QueueShareMemoryRegionWhenReady() which performs emplace_back(), while a ThreadPool worker calls PostCallbacks() which iterates and clears the same vector. When emplace_back() triggers a vector reallocation during an ongoing PostCallbacks() iteration, the old backing buffer is freed while the iterator still references it, producing a use-after-free in the browser process. This affects Android only.
Bisect
Introducing Commit: a2dece8510578768eda1202047001188639802ba
- Date: 2019-06-13
- Author: Dominik Rottsches
- Review: https://chromium-review.googlesource.com/c/chromium/src/+/1655315
Root Cause
FontUniqueNameLookup is a NoDestructor singleton instantiated early during browser startup via PostCreateThreadsImpl. Its constructor calls ScheduleLoadOrUpdateTable(), which posts a BEST_EFFORT task to a ThreadPool worker to scan system fonts, build a lookup table, and then dispatch pending callbacks:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:212-235
void FontUniqueNameLookup::ScheduleLoadOrUpdateTable() {
base::ThreadPool::PostTask(
FROM_HERE,
{base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::BindOnce(
[](FontUniqueNameLookup* instance) {
instance->LoadFromFile();
if (instance->UpdateTableIfNeeded()) {
instance->PersistToFile();
}
instance->proto_storage_ready_.Signal();
instance->PostCallbacks();
},
base::Unretained(this)));
}
PostCallbacks() runs on that ThreadPool worker thread, iterating pending_callbacks_ via range-for and clearing it afterward:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:285-292
void FontUniqueNameLookup::PostCallbacks() {
for (auto& pending_callback : pending_callbacks_) {
pending_callback.task_runner->PostTask(
FROM_HERE, base::BindOnce(std::move(pending_callback.mojo_callback),
DuplicateMemoryRegion()));
}
pending_callbacks_.clear();
}
Concurrently, renderer processes request the font lookup table through a Mojo interface. The service handler runs on its own SequencedTaskRunner, separate from both the UI thread and the ThreadPool worker above. When the table is not yet ready, it queues a callback:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_service.cc:44-53
void FontUniqueNameLookupService::GetUniqueNameLookupTable(
GetUniqueNameLookupTableCallback callback) {
DCHECK(GetTaskRunner()->RunsTasksInCurrentSequence());
if (font_unique_name_lookup_->IsValid()) {
std::move(callback).Run(font_unique_name_lookup_->DuplicateMemoryRegion());
} else {
font_unique_name_lookup_->QueueShareMemoryRegionWhenReady(
GetTaskRunner(), std::move(callback));
}
}
QueueShareMemoryRegionWhenReady() simply appends to the vector:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:145-149
void FontUniqueNameLookup::QueueShareMemoryRegionWhenReady(
scoped_refptr<base::SequencedTaskRunner> task_runner,
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback
callback) {
pending_callbacks_.emplace_back(std::move(task_runner), std::move(callback));
}
The class declaration reveals no synchronization protecting pending_callbacks_:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.h:134-145
struct CallbackOnTaskRunner {
CallbackOnTaskRunner(
scoped_refptr<base::SequencedTaskRunner>,
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback);
CallbackOnTaskRunner(CallbackOnTaskRunner&&);
~CallbackOnTaskRunner();
scoped_refptr<base::SequencedTaskRunner> task_runner;
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback
mojo_callback;
};
std::vector<CallbackOnTaskRunner> pending_callbacks_;
There is no mutex, no SEQUENCE_CHECKER, and no GUARDED_BY annotation. The WaitableEvent proto_storage_ready_ only synchronizes access to proto_storage_, not to pending_callbacks_.
The race unfolds as a TOCTOU: a service sequence call checks IsValid() and observes false (the table is not ready). Before it executes emplace_back(), the ThreadPool worker finishes building the table, calls Signal(), and enters PostCallbacks(). The service call then executes emplace_back() while PostCallbacks() is iterating. If the emplace_back() exceeds the vector's capacity, std::vector reallocates its backing buffer and frees the old one. The range-for iterator in PostCallbacks() still points into the freed buffer; the subsequent dereference of pending_callback.task_runner is a use-after-free.
This bug is not mitigated by MiraclePtr. The dangling access occurs through a std::vector range-for iterator/reference, not through a raw_ptr<T> field. MiraclePtr only protects raw_ptr<T> smart pointer fields allocated through PartitionAlloc. STL container iterators and element references are entirely outside its scope.
From a renderer, the attack surface is the FontFace API. new FontFace('name', 'local(...)').load() triggers LocalFontFaceSource::BeginLoadIfNeeded(), which calls through to FontUniqueNameLookupAndroid::PrepareFontUniqueNameLookup(), sending a GetUniqueNameLookupTable Mojo IPC to the browser. With kPrefetchFontLookupTables enabled by default on Android, each new renderer process also sends this IPC automatically during initialization.
Reproduce
Tested at commit 457566e1c0b4197b30d7532c4d7430b2ef738765 on Android (Pixel 7 Pro, HWASAN userdebug build).
The attached patch.diff inserts Sleep() calls to make the race deterministically reproducible under HWASAN. The patch makes four changes:
- In the renderer, it removes the IPC deduplication guard in
PrepareFontUniqueNameLookup()so that eachFontFace.load()call sends a separateGetUniqueNameLookupTableIPC to the browser, simulating a compromised renderer flooding the service. - In the browser service handler (
GetUniqueNameLookupTable), it inserts a 2-second sleep between theIsValid()check and theemplace_back()call, widening the TOCTOU window so thatSignal()andPostCallbacks()can begin on the ThreadPool worker while the service sequence is still about to append. - In
PostCallbacks(), it inserts a 5-second sleep per element iteration, keeping the range-for loop alive long enough for a concurrentemplace_back()to land and trigger vector reallocation mid-iteration. - In
ScheduleLoadOrUpdateTable(), it inserts a 6-second initial delay before the font table build begins, ensuring renderer IPCs arrive and queue callbacks before the table becomes valid.
Build configuration (out/android/args.gn):
target_os = "android"
target_cpu = "arm64"
is_debug = false
dcheck_always_on = false
is_component_build = false
is_hwasan = true
android_static_analysis = "off"
Apply the patch and build:
cd ~/chromium/src
git apply patch.diff
autoninja -C out/android chrome_public_apk
out/android/bin/chrome_public_apk install
The --no-first-run --disable-fre flags skip the Android First Run Experience dialog, which would otherwise block page loading and prevent the PoC from executing during the startup window:
adb shell am force-stop org.chromium.chrome
adb logcat -c
python3 -m http.server 8880 --bind 0.0.0.0 &
adb reverse tcp:8880 tcp:8880
out/android/bin/chrome_public_apk launch \
--args='--no-first-run --disable-fre --enable-logging=stderr' \
http://localhost:8880/poc.html
The browser process crashes with an HWASAN tag-mismatch within approximately 16 seconds.
Symbolized stack:
#0 scoped_refptr<base::SequencedTaskRunner>::operator->() const
base/memory/scoped_refptr.h:293
content::FontUniqueNameLookup::PostCallbacks()
content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:292
#1 base::OnceCallback<void ()>::Run()
base/functional/callback.h:155
base::TaskAnnotator::RunTaskImpl()
base/task/common/task_annotator.cc:229
#2 base::internal::TaskTracker::RunTaskImpl()
base/task/thread_pool/task_tracker.cc:691
...
#9 base::(anonymous namespace)::ThreadFunc(void*)
base/threading/platform_thread_posix.cc:102
Full HWASAN report:
==5416==ERROR: HWAddressSanitizer: tag-mismatch on address 0x0043d831ade0 at pc 0x00666bc49608
READ of size 8 at 0x0043d831ade0 tags: 9f/26 (ptr/mem) in thread T113
#0 0x00666bc49608 (libchrome.so+0x7d6f608)
#1 0x00666ffb2770 (libchrome.so+0xc0d8770)
#2 0x0066700116cc (libchrome.so+0xc1376cc)
#3 0x006670011504 (libchrome.so+0xc137504)
#4 0x0066700109cc (libchrome.so+0xc1369cc)
#5 0x006670010018 (libchrome.so+0xc136018)
#6 0x006670022148 (libchrome.so+0xc148148)
#7 0x00667002181c (libchrome.so+0xc14781c)
#8 0x0066700214d8 (libchrome.so+0xc1474d8)
#9 0x0066700636e0 (libchrome.so+0xc1896e0)
#10 0x0070c0cfdf2c (libc.so+0x96f2c)
#11 0x0070c0ce73d0 (libc.so+0x803d0)
[0x0043d831ade0,0x0043d831ae00) is a small allocated heap chunk; size: 32 offset: 0
Memory tags around the buggy address (one tag corresponds to 16 bytes):
0x0043d831ac00: 0b fc 04 00 ed 08 14 00 47 47 08 00 62 06 5a 5a
=>0x0043d831ad00: ea ea 08 00 64 01 0b d8 7b 06 df cf f6 08 [26] 26
0x0043d831ae00: 80 00 c3 c3 5d 5d 93 00 65 00 8b 8b 3b 3b 1d 00
SUMMARY: HWAddressSanitizer: tag-mismatch (libchrome.so+0x7d6f608)
Credit
Please use c6eed09fc8b174b0f3eebedcceb1e792 as the credit for this vulnerability. Thank you.
References
- font_unique_name_lookup_android.cc (PostCallbacks)
- font_unique_name_lookup_android.cc (QueueShareMemoryRegionWhenReady)
- font_unique_name_lookup_android.cc (ScheduleLoadOrUpdateTable)
- font_unique_name_lookup_service.cc (GetUniqueNameLookupTable)
- font_unique_name_lookup_android.h (pending_callbacks_ declaration)
Context
content::FontUniqueNameLookup is a browser-process singleton on Android that maps local font names to unique identifiers so that renderers can resolve local(...) font sources. It is created early during browser startup as a NoDestructor singleton via PostCreateThreadsImpl, and its constructor calls ScheduleLoadOrUpdateTable(), which posts a BEST_EFFORT task to a ThreadPool worker. That worker scans the system fonts, builds a lookup table, persists it, signals proto_storage_ready_, and then dispatches any callbacks that were queued while the table was still being built.
Renderers reach the table through a Mojo interface. The service handler runs on its own SequencedTaskRunner, separate from both the UI thread and the ThreadPool worker. When the table is not yet valid, the handler queues the caller's callback in a std::vector<CallbackOnTaskRunner> pending_callbacks_ and returns; the ThreadPool worker later drains that vector.
The report describes a cross-thread race on that vector: one thread appends to it while another iterates and clears it, with no synchronisation. The result is a use-after-free in the browser process. The issue affects Android only.
Setup
The bug was introduced by commit [redacted] (2019-06-13, author Dominik Rottsches, review https://chromium-review.googlesource.com/c/chromium/src/+/1655315).
Reproduction was done at commit [redacted] on a Pixel 7 Pro running an HWASAN userdebug build. The build configuration used (out/android/args.gn):
target_os = "android"
target_cpu = "arm64"
is_debug = false
dcheck_always_on = false
is_component_build = false
is_hwasan = true
android_static_analysis = "off"
A patch.diff was attached to the report to make the race deterministic under HWASAN. It makes four changes:
- In the renderer, it removes the IPC deduplication guard in
PrepareFontUniqueNameLookup()so that eachFontFace.load()call sends a separateGetUniqueNameLookupTableIPC to the browser, simulating a compromised renderer flooding the service. - In the browser service handler (
GetUniqueNameLookupTable), it inserts a 2-second sleep between theIsValid()check and theemplace_back()call, widening the TOCTOU window so thatSignal()andPostCallbacks()can begin on the ThreadPool worker while the service sequence is still about to append. - In
PostCallbacks(), it inserts a 5-second sleep per element iteration, keeping the range-for loop alive long enough for a concurrentemplace_back()to land and trigger vector reallocation mid-iteration. - In
ScheduleLoadOrUpdateTable(), it inserts a 6-second initial delay before the font table build begins, ensuring renderer IPCs arrive and queue callbacks before the table becomes valid.
Finding it
The class declaration shows no synchronisation protecting pending_callbacks_:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.h:134-145
struct CallbackOnTaskRunner {
CallbackOnTaskRunner(
scoped_refptr<base::SequencedTaskRunner>,
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback);
CallbackOnTaskRunner(CallbackOnTaskRunner&&);
~CallbackOnTaskRunner();
scoped_refptr<base::SequencedTaskRunner> task_runner;
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback
mojo_callback;
};
std::vector<CallbackOnTaskRunner> pending_callbacks_;
There is no mutex, no SEQUENCE_CHECKER, and no GUARDED_BY annotation. The WaitableEvent proto_storage_ready_ only synchronises access to proto_storage_, not to pending_callbacks_.
The two accessors run on different threads. QueueShareMemoryRegionWhenReady() appends to the vector from the Mojo service sequence:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:145-149
void FontUniqueNameLookup::QueueShareMemoryRegionWhenReady(
scoped_refptr<base::SequencedTaskRunner> task_runner,
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback
callback) {
pending_callbacks_.emplace_back(std::move(task_runner), std::move(callback));
}
PostCallbacks() iterates the same vector with a range-for and then clears it, on the ThreadPool worker:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:285-292
void FontUniqueNameLookup::PostCallbacks() {
for (auto& pending_callback : pending_callbacks_) {
pending_callback.task_runner->PostTask(
FROM_HERE, base::BindOnce(std::move(pending_callback.mojo_callback),
DuplicateMemoryRegion()));
}
pending_callbacks_.clear();
}
The worker is scheduled from the constructor:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:212-235
void FontUniqueNameLookup::ScheduleLoadOrUpdateTable() {
base::ThreadPool::PostTask(
FROM_HERE,
{base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::BindOnce(
[](FontUniqueNameLookup* instance) {
instance->LoadFromFile();
if (instance->UpdateTableIfNeeded()) {
instance->PersistToFile();
}
instance->proto_storage_ready_.Signal();
instance->PostCallbacks();
},
base::Unretained(this)));
}
And the service handler decides between answering immediately and queueing:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_service.cc:44-53
void FontUniqueNameLookupService::GetUniqueNameLookupTable(
GetUniqueNameLookupTableCallback callback) {
DCHECK(GetTaskRunner()->RunsTasksInCurrentSequence());
if (font_unique_name_lookup_->IsValid()) {
std::move(callback).Run(font_unique_name_lookup_->DuplicateMemoryRegion());
} else {
font_unique_name_lookup_->QueueShareMemoryRegionWhenReady(
GetTaskRunner(), std::move(callback));
}
}
The race is a TOCTOU. The service sequence checks IsValid() and observes false because the table is not ready. Before it executes emplace_back(), the ThreadPool worker finishes building the table, calls Signal(), and enters PostCallbacks(). The service call then executes emplace_back() while PostCallbacks() is iterating. If the emplace_back() exceeds the vector's capacity, std::vector reallocates its backing buffer and frees the old one. The range-for iterator in PostCallbacks() still points into the freed buffer, and the subsequent dereference of pending_callback.task_runner is a use-after-free.
MiraclePtr does not mitigate this. The dangling access goes through a std::vector range-for iterator/reference, not through a raw_ptr<T> field. MiraclePtr only protects raw_ptr<T> smart pointer fields allocated through PartitionAlloc; STL container iterators and element references are entirely outside its scope.
From a renderer, the attack surface is the FontFace API. new FontFace('name', 'local(...)').load() triggers LocalFontFaceSource::BeginLoadIfNeeded(), which calls through to FontUniqueNameLookupAndroid::PrepareFontUniqueNameLookup(), sending a GetUniqueNameLookupTable Mojo IPC to the browser. With kPrefetchFontLookupTables enabled by default on Android, each new renderer process also sends this IPC automatically during initialisation.
Exploitation
Step 1: apply the patch and build
cd ~/chromium/src
git apply patch.diff
autoninja -C out/android chrome_public_apk
out/android/bin/chrome_public_apk install
The patch adds the sleeps described in Setup, making the race deterministic under HWASAN.
Step 2: prepare the device and serve the PoC
The --no-first-run --disable-fre flags skip the Android First Run Experience dialog, which would otherwise block page loading and prevent the PoC from executing during the startup window:
adb shell am force-stop org.chromium.chrome
adb logcat -c
python3 -m http.server 8880 --bind [redacted] &
adb reverse tcp:8880 tcp:8880
out/android/bin/chrome_public_apk launch \
--args='--no-first-run --disable-fre --enable-logging=stderr' \
http://localhost:8880/poc.html
The local HTTP server on port 8880 is exposed to the device through adb reverse, and Chrome is launched directly at poc.html with logging to stderr.
Step 3: observe the crash
The browser process crashes with an HWASAN tag-mismatch within approximately 16 seconds. The symbolized stack points at the dereference of the task runner inside PostCallbacks():
#0 scoped_refptr<base::SequencedTaskRunner>::operator->() const
base/memory/scoped_refptr.h:293
content::FontUniqueNameLookup::PostCallbacks()
content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:292
#1 base::OnceCallback<void ()>::Run()
base/functional/callback.h:155
base::TaskAnnotator::RunTaskImpl()
base/task/common/task_annotator.cc:229
#2 base::internal::TaskTracker::RunTaskImpl()
base/task/thread_pool/task_tracker.cc:691
...
#9 base::(anonymous namespace)::ThreadFunc(void*)
base/threading/platform_thread_posix.cc:102
The full HWASAN report:
==5416==ERROR: HWAddressSanitizer: tag-mismatch on address 0x0043d831ade0 at pc 0x00666bc49608
READ of size 8 at 0x0043d831ade0 tags: 9f/26 (ptr/mem) in thread T113
#0 0x00666bc49608 (libchrome.so+0x7d6f608)
#1 0x00666ffb2770 (libchrome.so+0xc0d8770)
#2 0x0066700116cc (libchrome.so+0xc1376cc)
#3 0x006670011504 (libchrome.so+0xc137504)
#4 0x0066700109cc (libchrome.so+0xc1369cc)
#5 0x006670010018 (libchrome.so+0xc136018)
#6 0x006670022148 (libchrome.so+0xc148148)
#7 0x00667002181c (libchrome.so+0xc14781c)
#8 0x0066700214d8 (libchrome.so+0xc1474d8)
#9 0x0066700636e0 (libchrome.so+0xc1896e0)
#10 0x0070c0cfdf2c (libc.so+0x96f2c)
#11 0x0070c0ce73d0 (libc.so+0x803d0)
[0x0043d831ade0,0x0043d831ae00) is a small allocated heap chunk; size: 32 offset: 0
Memory tags around the buggy address (one tag corresponds to 16 bytes):
0x0043d831ac00: 0b fc 04 00 ed 08 14 00 47 47 08 00 62 06 5a 5a
=>0x0043d831ad00: ea ea 08 00 64 01 0b d8 7b 06 df cf f6 08 [26] 26
0x0043d831ae00: 80 00 c3 c3 5d 5d 93 00 65 00 8b 8b 3b 3b 1d 00
SUMMARY: HWAddressSanitizer: tag-mismatch (libchrome.so+0x7d6f608)
The HWASAN report shows a tag mismatch on a small 32-byte heap chunk.
Root cause
pending_callbacks_ is a plain std::vector shared between two threads with no lock, no sequence checker and no annotation. The service sequence appends via emplace_back(); the ThreadPool worker iterates and clears. The IsValid() check and the append are not atomic with respect to the worker signalling readiness and starting PostCallbacks(), so an append can land during iteration. When that append grows the vector, the old buffer is freed and the iterator dangles.
The existing WaitableEvent proto_storage_ready_ does not help because it guards proto_storage_, not the callback vector. MiraclePtr does not help because the dangling reference is an STL iterator, not a raw_ptr<T>.
Impact
The report describes a use-after-free in the browser process, reachable from a renderer through the FontFace API and, on Android with kPrefetchFontLookupTables enabled by default, also automatically during renderer initialisation. The crash is demonstrated under HWASAN; the report does not describe a working exploit beyond the crash. The issue affects Android only. The platform records the severity as medium and a bounty of 3000.00 USD.
Fix
The report does not state which change was made to fix the bug. The obvious remedy, given the root cause, is to serialise all access to pending_callbacks_ on a single sequence or protect it with a lock, so that appending and draining cannot overlap.
Variants to test
- Other
NoDestructorbrowser-process singletons that post aBEST_EFFORTThreadPool task from their constructor and later drain a callback container. A positive result is a container mutated from two task runners with no lock orSEQUENCE_CHECKER. - Mojo service handlers that check a readiness flag and then append to a shared structure. A positive result is a TOCTOU between the check and the append, as here.
WaitableEvent-guarded state where the event protects one field but a neighbouring field is accessed without it. A positive result is a second field read or written outside the event's protection.std::vectormembers accessed through range-for on one thread andemplace_back()/push_back()on another. A positive result is a reallocation during iteration, visible under HWASAN or ASAN as a tag mismatch or heap-use-after-free.- Renderer-triggered APIs that flood a browser-side queue, such as font lookup, with the deduplication guard removed. A positive result is a crash whose stack points into the draining loop rather than the IPC handler.
What happened, in plain words
Chrome on Android has a small helper inside its main program (the browser process) that keeps a list of font names. When a web page asks to use a font that is installed on the phone, Chrome needs to know which exact font file that name refers to, and this helper provides the answer.
Building that list takes time, so Chrome starts the work in the background at startup. While the list is being built, any web page that asks for it is put on hold: Chrome writes down a note saying "answer this page later" and carries on. When the background work finishes, Chrome goes through the notes and answers everyone.
The problem is that two different workers touch the same list of notes at the same time, and nothing stops them from stepping on each other. One worker adds a note while the other is reading through the notes and deleting them. If the add happens at the wrong moment, the memory holding the notes is thrown away while the reader is still looking at it. The reader then reads memory that no longer belongs to it. In programming this is called a use-after-free: using something after it has been freed.
This only affects Android. The report demonstrates the crash with a special instrumented build of Chrome, and the platform records it as a medium severity issue with a 3000.00 USD bounty.
The pieces involved
Before the details, here are the main parts of Chrome that the report talks about.
- Browser process: the main Chrome program. It is the trusted part that talks to the operating system, the network and the disk. Web pages run in separate, less trusted programs called renderers.
- Renderer: the process that runs a web page's code. It is deliberately kept at arm's length from the browser process, and it can only ask the browser for things through a controlled channel.
- Mojo: that controlled channel. It is Chrome's system for sending messages between processes, a bit like a reception desk that only accepts forms in an approved format.
- IPC: inter-process communication, the general name for one program sending a message to another on the same machine.
- Singleton: an object of which exactly one copy exists for the whole program. Think of the single front door of a building: there is only one, and everyone uses it.
- Thread: a worker inside a program. A program can have several workers doing things at the same time, and they share the same memory.
- Race condition: a bug that appears only when two workers do things in an unlucky order. If the timing is different, nothing goes wrong. It is like two people reaching for the same door handle at once: usually one goes first, but sometimes they collide.
- Use-after-free: reading or writing memory that has already been released. The memory may now belong to something else, so the program can crash or, in the worst case, be made to do something unintended.
- TOCTOU: "time of check to time of use". A worker checks a condition, and by the time it acts on the result, the situation has changed. Like checking that a parking space is free, then finding another car has taken it before you drive in.
content::FontUniqueNameLookup is the singleton in question. Its job is to map local font names to unique identifiers so that renderers can resolve local(...) font sources. In CSS, local(...) means "use a font that is already installed on this device rather than downloading one". The helper is created early during browser startup as a NoDestructor singleton via PostCreateThreadsImpl. NoDestructor means the object is never destroyed, which is convenient for something that must live for the whole session.
Its constructor calls ScheduleLoadOrUpdateTable(), which posts a BEST_EFFORT task to a ThreadPool worker. A ThreadPool is a pool of reusable workers; BEST_EFFORT means the task runs at low priority, when the machine has spare capacity. That worker scans the system fonts, builds a lookup table, saves it, signals proto_storage_ready_, and then dispatches any callbacks that were queued while the table was still being built.
Renderers reach the table through a Mojo interface. The service handler runs on its own SequencedTaskRunner, separate from both the UI thread and the ThreadPool worker. A SequencedTaskRunner is a queue that guarantees its tasks run one after another, in order, but not necessarily on any particular thread. When the table is not yet valid, the handler queues the caller's callback in a std::vector<CallbackOnTaskRunner> pending_callbacks_ and returns; the ThreadPool worker later drains that vector. A std::vector is a growable list in C++, and a callback is a piece of code saved to be run later, like a note saying "when the answer is ready, call this number".
The report describes a cross-thread race on that vector: one thread appends to it while another iterates and clears it, with no synchronisation. The result is a use-after-free in the browser process. The issue affects Android only.
Setup
The bug was introduced by commit [redacted] (2019-06-13, author Dominik Rottsches, review https://chromium-review.googlesource.com/c/chromium/src/+/1655315). A commit is a saved change to the source code, and the long string is its unique fingerprint.
Reproduction was done at commit [redacted] on a Pixel 7 Pro running an HWASAN userdebug build. HWASAN stands for Hardware-assisted AddressSanitizer. It is a debugging tool built into the compiler that tags chunks of memory and checks the tags on every access, so that a read of freed memory is caught immediately instead of silently returning garbage. A userdebug build is a development build of Android that allows more debugging than a normal consumer phone.
The build configuration used (out/android/args.gn):
target_os = "android"
target_cpu = "arm64"
is_debug = false
dcheck_always_on = false
is_component_build = false
is_hwasan = true
android_static_analysis = "off"
Line by line:
target_os = "android": build Chrome for Android.target_cpu = "arm64": build for 64-bit ARM processors, the kind used in most modern phones.is_debug = false: make an optimised build rather than a slow debugging build.dcheck_always_on = false: do not keep debug-only assertions switched on in this build.is_component_build = false: link everything into one large library instead of many small ones.is_hwasan = true: switch on the HWASAN memory checker.android_static_analysis = "off": skip static analysis during the build, which saves time.
A patch.diff was attached to the report to make the race deterministic under HWASAN. Normally a race depends on luck; the patch removes the luck by inserting delays, so the bad ordering happens every time. It makes four changes:
- In the renderer, it removes the IPC deduplication guard in
PrepareFontUniqueNameLookup()so that eachFontFace.load()call sends a separateGetUniqueNameLookupTableIPC to the browser, simulating a compromised renderer flooding the service. Deduplication here means "if we already asked, do not ask again"; removing it lets the page send many requests. - In the browser service handler (
GetUniqueNameLookupTable), it inserts a 2-second sleep between theIsValid()check and theemplace_back()call, widening the TOCTOU window so thatSignal()andPostCallbacks()can begin on the ThreadPool worker while the service sequence is still about to append. - In
PostCallbacks(), it inserts a 5-second sleep per element iteration, keeping the range-for loop alive long enough for a concurrentemplace_back()to land and trigger vector reallocation mid-iteration. - In
ScheduleLoadOrUpdateTable(), it inserts a 6-second initial delay before the font table build begins, ensuring renderer IPCs arrive and queue callbacks before the table becomes valid.
Finding it
The class declaration shows no synchronisation protecting pending_callbacks_:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.h:134-145
struct CallbackOnTaskRunner {
CallbackOnTaskRunner(
scoped_refptr<base::SequencedTaskRunner>,
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback);
CallbackOnTaskRunner(CallbackOnTaskRunner&&);
~CallbackOnTaskRunner();
scoped_refptr<base::SequencedTaskRunner> task_runner;
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback
mojo_callback;
};
std::vector<CallbackOnTaskRunner> pending_callbacks_;
Line by line:
struct CallbackOnTaskRunner {: declares a small bundle of data with that name. A struct groups related values together, like a form with several fields.CallbackOnTaskRunner(: the constructor, the code that creates one of these bundles.scoped_refptr<base::SequencedTaskRunner>,: the first thing a bundle holds, a reference-counted pointer to a task runner. Reference counting means the object is kept alive while at least one pointer refers to it.blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback);: the second thing, the saved callback to run later.CallbackOnTaskRunner(CallbackOnTaskRunner&&);: a move constructor, which transfers the contents from one bundle to another efficiently.~CallbackOnTaskRunner();: the destructor, which runs when a bundle is thrown away.scoped_refptr<base::SequencedTaskRunner> task_runner;: the stored task runner field.blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback mojo_callback;: the stored callback field.};: ends the struct.std::vector<CallbackOnTaskRunner> pending_callbacks_;: the growable list of these bundles, the shared object at the centre of the bug.
There is no mutex, no SEQUENCE_CHECKER, and no GUARDED_BY annotation. A mutex is a lock that only one worker can hold at a time, like a single key to a room. A SEQUENCE_CHECKER is a debugging helper that records which queue a piece of code is supposed to run on and complains if it runs elsewhere. A GUARDED_BY annotation tells the compiler which lock protects which field, so that mistakes can be flagged. The WaitableEvent proto_storage_ready_ only synchronises access to proto_storage_, not to pending_callbacks_. A WaitableEvent is a signal that one worker can wait on until another worker raises it, like a flag at a railway station.
The two accessors run on different threads. QueueShareMemoryRegionWhenReady() appends to the vector from the Mojo service sequence:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:145-149
void FontUniqueNameLookup::QueueShareMemoryRegionWhenReady(
scoped_refptr<base::SequencedTaskRunner> task_runner,
blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback
callback) {
pending_callbacks_.emplace_back(std::move(task_runner), std::move(callback));
}
Line by line:
void FontUniqueNameLookup::QueueShareMemoryRegionWhenReady(: defines a function on the singleton that queues a request for later.scoped_refptr<base::SequencedTaskRunner> task_runner,: the queue on which the answer should be delivered.blink::mojom::FontUniqueNameLookup::GetUniqueNameLookupTableCallback callback) {: the callback to run with the answer.pending_callbacks_.emplace_back(std::move(task_runner), std::move(callback));: adds a new bundle to the end of the list.emplace_backbuilds the bundle directly inside the list, andstd::movehands over the values instead of copying them.}: ends the function.
PostCallbacks() iterates the same vector with a range-for and then clears it, on the ThreadPool worker:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:285-292
void FontUniqueNameLookup::PostCallbacks() {
for (auto& pending_callback : pending_callbacks_) {
pending_callback.task_runner->PostTask(
FROM_HERE, base::BindOnce(std::move(pending_callback.mojo_callback),
DuplicateMemoryRegion()));
}
pending_callbacks_.clear();
}
Line by line:
void FontUniqueNameLookup::PostCallbacks() {: defines the function that answers everyone who was waiting.for (auto& pending_callback : pending_callbacks_) {: walks through the list one bundle at a time. The&means it refers to the stored bundle rather than making a copy.pending_callback.task_runner->PostTask(: on the stored queue, schedules a task.FROM_HERE, base::BindOnce(std::move(pending_callback.mojo_callback),: the task is the stored callback, moved out of the bundle so it can run exactly once.DuplicateMemoryRegion()));: and it is given a copy of the font table memory to hand back.}: ends the loop.pending_callbacks_.clear();: empties the list now that everyone has been answered.}: ends the function.
The worker is scheduled from the constructor:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:212-235
void FontUniqueNameLookup::ScheduleLoadOrUpdateTable() {
base::ThreadPool::PostTask(
FROM_HERE,
{base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::BindOnce(
[](FontUniqueNameLookup* instance) {
instance->LoadFromFile();
if (instance->UpdateTableIfNeeded()) {
instance->PersistToFile();
}
instance->proto_storage_ready_.Signal();
instance->PostCallbacks();
},
base::Unretained(this)));
}
Line by line:
void FontUniqueNameLookup::ScheduleLoadOrUpdateTable() {: defines the function that arranges the background font scan.base::ThreadPool::PostTask(: hands a job to the thread pool.FROM_HERE,: records where the job was posted from, for debugging.{base::MayBlock(), base::TaskPriority::BEST_EFFORT,: options.MayBlockmeans the job is allowed to wait on disk or other slow operations;BEST_EFFORTmeans low priority.base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},: if Chrome shuts down, let this job finish rather than cancelling it.base::BindOnce(: packages a function to be called once, later.[](FontUniqueNameLookup* instance) {: the packaged function, which receives a pointer to the singleton.instance->LoadFromFile();: reads any previously saved font table from disk.if (instance->UpdateTableIfNeeded()) {: checks whether the table needs rebuilding.instance->PersistToFile();: if so, saves the new table to disk.}: ends the if.instance->proto_storage_ready_.Signal();: raises the flag that says the table is ready.instance->PostCallbacks();: answers everyone who was waiting.},: ends the packaged function.base::Unretained(this)));: passes the singleton pointer without taking ownership of it.Unretainedmeans "do not keep this object alive on my account".}: ends the function.
And the service handler decides between answering immediately and queueing:
// content/browser/font_unique_name_lookup/font_unique_name_lookup_service.cc:44-53
void FontUniqueNameLookupService::GetUniqueNameLookupTable(
GetUniqueNameLookupTableCallback callback) {
DCHECK(GetTaskRunner()->RunsTasksInCurrentSequence());
if (font_unique_name_lookup_->IsValid()) {
std::move(callback).Run(font_unique_name_lookup_->DuplicateMemoryRegion());
} else {
font_unique_name_lookup_->QueueShareMemoryRegionWhenReady(
GetTaskRunner(), std::move(callback));
}
}
Line by line:
void FontUniqueNameLookupService::GetUniqueNameLookupTable(: defines the handler for the Mojo request.GetUniqueNameLookupTableCallback callback) {: the callback to answer the renderer with.DCHECK(GetTaskRunner()->RunsTasksInCurrentSequence());: a debug-only check that this code is running on the queue it expects.if (font_unique_name_lookup_->IsValid()) {: if the table is already built, answer straight away.std::move(callback).Run(font_unique_name_lookup_->DuplicateMemoryRegion());: run the callback with a copy of the table.} else {: otherwise the table is not ready.font_unique_name_lookup_->QueueShareMemoryRegionWhenReady(: queue the callback for later.GetTaskRunner(), std::move(callback));: passing the queue to answer on and the callback itself.}: ends the if/else.}: ends the function.
The race is a TOCTOU. The service sequence checks IsValid() and observes false because the table is not ready. Before it executes emplace_back(), the ThreadPool worker finishes building the table, calls Signal(), and enters PostCallbacks(). The service call then executes emplace_back() while PostCallbacks() is iterating. If the emplace_back() exceeds the vector's capacity, std::vector reallocates its backing buffer and frees the old one. The range-for iterator in PostCallbacks() still points into the freed buffer, and the subsequent dereference of pending_callback.task_runner is a use-after-free.
A vector has a fixed amount of reserved space. When it runs out, it asks for a bigger block of memory, copies everything across, and releases the old block. Anyone still holding a pointer into the old block is now pointing at freed memory. That is exactly what happens here.
MiraclePtr does not mitigate this. MiraclePtr is a Chrome defence that makes certain pointer types refuse to hand back freed memory. The dangling access here goes through a std::vector range-for iterator/reference, not through a raw_ptr<T> field. MiraclePtr only protects raw_ptr<T> smart pointer fields allocated through PartitionAlloc; STL container iterators and element references are entirely outside its scope. PartitionAlloc is Chrome's own memory allocator, and raw_ptr<T> is a pointer type that cooperates with MiraclePtr.
From a renderer, the attack surface is the FontFace API. An API is a set of functions a program offers to other programs; here it is the browser feature that web pages use to load fonts. new FontFace('name', 'local(...)').load() triggers LocalFontFaceSource::BeginLoadIfNeeded(), which calls through to FontUniqueNameLookupAndroid::PrepareFontUniqueNameLookup(), sending a GetUniqueNameLookupTable Mojo IPC to the browser. With kPrefetchFontLookupTables enabled by default on Android, each new renderer process also sends this IPC automatically during initialisation. Prefetching means fetching something before it is asked for, to save time later.
Exploitation
Step 1: apply the patch and build
cd ~/chromium/src
git apply patch.diff
autoninja -C out/android chrome_public_apk
out/android/bin/chrome_public_apk install
Line by line:
cd ~/chromium/src: move into the folder holding the Chrome source code.git apply patch.diff: apply the changes stored in the patch file to the source.autoninja -C out/android chrome_public_apk: build the Android Chrome app using the configuration inout/android.out/android/bin/chrome_public_apk install: install the freshly built app on the connected phone.
The patch adds the sleeps described in Setup, making the race deterministic under HWASAN.
Step 2: prepare the device and serve the PoC
The --no-first-run --disable-fre flags skip the Android First Run Experience dialog, which would otherwise block page loading and prevent the PoC from executing during the startup window:
adb shell am force-stop org.chromium.chrome
adb logcat -c
python3 -m http.server 8880 --bind [redacted] &
adb reverse tcp:8880 tcp:8880
out/android/bin/chrome_public_apk launch \
--args='--no-first-run --disable-fre --enable-logging=stderr' \
http://localhost:8880/poc.html
Line by line:
adb shell am force-stop org.chromium.chrome: stop any running copy of Chrome on the phone.adbis the Android Debug Bridge, a tool for controlling a phone from a computer.adb logcat -c: clear the phone's log buffer so the crash output is easy to find.python3 -m http.server 8880 --bind [redacted] &: start a simple web server on the computer, serving the current folder on port 8880, in the background.adb reverse tcp:8880 tcp:8880: make port 8880 on the phone forward to port 8880 on the computer, so the phone can reach the local server.out/android/bin/chrome_public_apk launch \: launch the built Chrome app.--args='--no-first-run --disable-fre --enable-logging=stderr' \: pass Chrome the flags that skip the first-run dialog and send logging to the error stream.http://localhost:8880/poc.html: open the proof-of-concept page. A PoC is a small demonstration that triggers the bug.
The local HTTP server on port 8880 is exposed to the device through adb reverse, and Chrome is launched directly at poc.html with logging to stderr.
Step 3: observe the crash
The browser process crashes with an HWASAN tag-mismatch within approximately 16 seconds. The symbolized stack points at the dereference of the task runner inside PostCallbacks(). A stack trace is the list of function calls that led to the crash, and symbolizing it means turning raw addresses into readable function names.
#0 scoped_refptr<base::SequencedTaskRunner>::operator->() const
base/memory/scoped_refptr.h:293
content::FontUniqueNameLookup::PostCallbacks()
content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:292
#1 base::OnceCallback<void ()>::Run()
base/functional/callback.h:155
base::TaskAnnotator::RunTaskImpl()
base/task/common/task_annotator.cc:229
#2 base::internal::TaskTracker::RunTaskImpl()
base/task/thread_pool/task_tracker.cc:691
...
#9 base::(anonymous namespace)::ThreadFunc(void*)
base/threading/platform_thread_posix.cc:102
Line by line:
#0 scoped_refptr<base::SequencedTaskRunner>::operator->() const: the innermost frame, where the crash happened. It is the code that follows the task runner pointer, which is exactly the dangling read.base/memory/scoped_refptr.h:293: the file and line of that code.content::FontUniqueNameLookup::PostCallbacks(): the function containing it, the loop that walks the freed list.content/browser/font_unique_name_lookup/font_unique_name_lookup_android.cc:292: the file and line inside that function.#1 base::OnceCallback<void ()>::Run(): the next frame out, the code that ran the saved callback.base/functional/callback.h:155: its file and line.base::TaskAnnotator::RunTaskImpl(): the task runner machinery that invoked the callback.base/task/common/task_annotator.cc:229: its file and line.#2 base::internal::TaskTracker::RunTaskImpl(): the thread pool's bookkeeping for running a task.base/task/thread_pool/task_tracker.cc:691: its file and line....: frames omitted for brevity.#9 base::(anonymous namespace)::ThreadFunc(void*): the outermost frame shown, the entry point of the worker thread.base/threading/platform_thread_posix.cc:102: its file and line.
The full HWASAN report:
==5416==ERROR: HWAddressSanitizer: tag-mismatch on address 0x0043d831ade0 at pc 0x00666bc49608
READ of size 8 at 0x0043d831ade0 tags: 9f/26 (ptr/mem) in thread T113
#0 0x00666bc49608 (libchrome.so+0x7d6f608)
#1 0x00666ffb2770 (libchrome.so+0xc0d8770)
#2 0x0066700116cc (libchrome.so+0xc1376cc)
#3 0x006670011504 (libchrome.so+0xc137504)
#4 0x0066700109cc (libchrome.so+0xc1369cc)
#5 0x006670010018 (libchrome.so+0xc136018)
#6 0x006670022148 (libchrome.so+0xc148148)
#7 0x00667002181c (libchrome.so+0xc14781c)
#8 0x0066700214d8 (libchrome.so+0xc1474d8)
#9 0x0066700636e0 (libchrome.so+0xc1896e0)
#10 0x0070c0cfdf2c (libc.so+0x96f2c)
#11 0x0070c0ce73d0 (libc.so+0x803d0)
[0x0043d831ade0,0x0043d831ae00) is a small allocated heap chunk; size: 32 offset: 0
Memory tags around the buggy address (one tag corresponds to 16 bytes):
0x0043d831ac00: 0b fc 04 00 ed 08 14 00 47 47 08 00 62 06 5a 5a
=>0x0043d831ad00: ea ea 08 00 64 01 0b d8 7b 06 df cf f6 08 [26] 26
0x0043d831ae00: 80 00 c3 c3 5d 5d 93 00 65 00 8b 8b 3b 3b 1d 00
SUMMARY: HWAddressSanitizer: tag-mismatch (libchrome.so+0x7d6f608)
Line by line:
==5416==ERROR: HWAddressSanitizer: tag-mismatch on address 0x0043d831ade0 at pc 0x00666bc49608: HWASAN reports that the tag on the pointer did not match the tag on the memory at that address. Thepcis the program counter, the instruction that made the access.READ of size 8 at 0x0043d831ade0 tags: 9f/26 (ptr/mem) in thread T113: an 8-byte read was attempted. The pointer carried tag9f, the memory carried tag26, so they do not match. The read happened on thread T113.#0to#11: the raw addresses of the call frames, insidelibchrome.soandlibc.so, with offsets into those libraries.[0x0043d831ade0,0x0043d831ae00) is a small allocated heap chunk; size: 32 offset: 0: the memory being read is a 32-byte chunk on the heap, the area where dynamically allocated objects live.Memory tags around the buggy address (one tag corresponds to 16 bytes):: HWASAN stores one tag per 16 bytes of memory. The dump shows the tags near the fault.- The three rows of hex numbers: the memory contents and their tags. The
=>marks the row containing the faulting address, and[26]marks the tag byte that did not match. SUMMARY: HWAddressSanitizer: tag-mismatch (libchrome.so+0x7d6f608): the one-line summary, pointing into Chrome's library.
The HWASAN report shows a tag mismatch on a small 32-byte heap chunk.
Root cause
pending_callbacks_ is a plain std::vector shared between two threads with no lock, no sequence checker and no annotation. The service sequence appends via emplace_back(); the ThreadPool worker iterates and clears. The IsValid() check and the append are not atomic with respect to the worker signalling readiness and starting PostCallbacks(), so an append can land during iteration. Atomic here means "happens as one indivisible step"; these two steps are not, so the worker can slip in between them. When that append grows the vector, the old buffer is freed and the iterator dangles.
The existing WaitableEvent proto_storage_ready_ does not help because it guards proto_storage_, not the callback vector. MiraclePtr does not help because the dangling reference is an STL iterator, not a raw_ptr<T>. STL stands for the Standard Template Library, the collection of ready-made containers such as std::vector that ship with C++.
Impact
The report describes a use-after-free in the browser process, reachable from a renderer through the FontFace API and, on Android with kPrefetchFontLookupTables enabled by default, also automatically during renderer initialisation. The crash is demonstrated under HWASAN; the report does not describe a working exploit beyond the crash. The issue affects Android only. The platform records the severity as medium and a bounty of 3000.00 USD.
Fix
The report does not state which change was made to fix the bug. The obvious remedy, given the root cause, is to serialise all access to pending_callbacks_ on a single sequence or protect it with a lock, so that appending and draining cannot overlap. Serialising means making the operations take turns instead of running at the same time.
Variants to test
- Other
NoDestructorbrowser-process singletons that post aBEST_EFFORTThreadPool task from their constructor and later drain a callback container. A positive result is a container mutated from two task runners with no lock orSEQUENCE_CHECKER. - Mojo service handlers that check a readiness flag and then append to a shared structure. A positive result is a TOCTOU between the check and the append, as here.
WaitableEvent-guarded state where the event protects one field but a neighbouring field is accessed without it. A positive result is a second field read or written outside the event's protection.std::vectormembers accessed through range-for on one thread andemplace_back()/push_back()on another. A positive result is a reallocation during iteration, visible under HWASAN or ASAN as a tag mismatch or heap-use-after-free. ASAN is AddressSanitizer, a similar memory checker that does not need special hardware.- Renderer-triggered APIs that flood a browser-side queue, such as font lookup, with the deduplication guard removed. A positive result is a crash whose stack points into the draining loop rather than the IPC handler.
Glossary
- API: a set of functions one program offers to another so they can work together.
- ASAN: AddressSanitizer, a memory checker that catches reads and writes of freed memory.
- Atomic: happening as one indivisible step that nothing else can interrupt.
- BEST_EFFORT: a low-priority task that runs when the machine has spare capacity.
- Browser process: the main, trusted Chrome program that handles the system, network and disk.
- Callback: a piece of code saved to be run later, when a result is ready.
- Commit: a saved change to source code, identified by a long fingerprint.
- Deduplication: skipping a request that has already been made.
- GUARDED_BY: a code annotation saying which lock protects which field.
- Heap: the area of memory where objects created while a program runs are stored.
- HWASAN: Hardware-assisted AddressSanitizer, a memory checker that tags memory and checks the tags on every access.
- IPC: inter-process communication, one program sending a message to another on the same machine.
- Iterator: an object that points at one element of a container while walking through it.
- MiraclePtr: a Chrome defence that makes certain pointer types refuse to hand back freed memory.
- Mojo: Chrome's system for sending messages between its processes.
- Mutex: a lock that only one worker can hold at a time.
- NoDestructor: a singleton that is never destroyed during the program's life.
- PartitionAlloc: Chrome's own memory allocator.
- PoC: proof of concept, a small demonstration that triggers a bug.
- Race condition: a bug that appears only when two workers act in an unlucky order.
- Range-for: a C++ loop that walks through every element of a container.
- raw_ptr: a pointer type that cooperates with MiraclePtr.
- Renderer: the separate, less trusted process that runs a web page.
- SEQUENCE_CHECKER: a debugging helper that records which queue code should run on and complains if it runs elsewhere.
- SequencedTaskRunner: a queue that runs its tasks one after another, in order.
- Stack trace: the list of function calls that led to a crash.
- STL: the Standard Template Library, C++'s collection of ready-made containers such as
std::vector. - Thread: a worker inside a program; several can run at the same time and share memory.
- ThreadPool: a pool of reusable workers that run tasks.
- TOCTOU: time of check to time of use, when a condition changes between checking it and acting on it.
- Userdebug build: a development build of Android that allows more debugging than a consumer phone.
- WaitableEvent: a signal one worker can wait on until another raises it.
std::vector: a growable list in C++ that reallocates its memory when it runs out of space.