DynamoRIO / DynamoRIO/dynamorio
CRASH: Race between page protection changes and handling readonly code fault
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
_From [rnk@google.com](https://code.google.com/u/rnk@google.com/) on December 06, 2012 11:21:12_
After receiving a SIGSEGV fault, we use compute_memory_target() to figure out if the memory access was a write to a read-only page. However, in this instance, allmem thinks that the page is read-write. I believe this is a race because I put in logging instrumentation that does the allmem lookup a second time, and on the second attempt allmem says the page is readonly. As a result, we say the target is NULL, which doesn't look like code modification, and we deliver the SIGSEGV to the app.
This manifests on medium Java apps that warm up enough to use the JIT.
What's the right way to fix this? The fundamental problem is that the app can trigger a codemod fault at pretty much any time before a thread synch barrier.
_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1009_
Contributor guide
Assessment
This issue has not been assessed yet.