DynamoRIO / DynamoRIO/dynamorio

ARM machine_cache_sync is not thread-safe

Open
#1,911 9 comments 0 reactions 0 assignees View on GitHub
Google-Affecting OpSys-AArch64 OpSys-ARM Priority-Low
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

According to sections B2.6.5 (AArch64) and E2.6.5 (AArch32) of the ARM ARM, when one CPU writes instructions that will be executed by another CPU, a number of operations must be performed on the first CPU (these are implemented by machine_cache_sync), and the second CPU must execute an ISB instruction when the modified instructions are observable and before it executes them. There does not appear to be any mechanism in place to ensure that the second CPU executes an ISB.

I do not know how likely it is that this non-conformance to the architecture specification will cause problems in practice. It is perhaps very unlikely. Also, I cannot see any efficient and easy way of forcing an ISB onto every CPU/thread.

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.