DynamoRIO / DynamoRIO/dynamorio

[drmemtrace] Races in AARCH64 drx_insert_counter_update()

Open
#7,525 1 comment 0 reactions 1 assignee Claimed by @edeiana View on GitHub
Component-DrMemtrace Component-Extension Hotlist-Release OpSys-AArch64
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

If the no-trace threshold is small enough, the tracer directly adds instructions that subtract from `instr_count` (the global no-trace instruction counter) through `drx_insert_counter_update()`: https://github.com/DynamoRIO/dynamorio/blob/master/clients/drcachesim/tracer/instr_counter.cpp#L371.
The load-counter->add/sub->store-counter instructions we use in the AARCH64 case are not thread safe and can cause races when updating the counter: https://github.com/DynamoRIO/dynamorio/blob/master/ext/drx/drx.c#L558.
We should use atomic instructions when available instead.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.