DynamoRIO / DynamoRIO/dynamorio

Support forging OS signals on Linux

Open
#4,356 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

**Users list discussion**
Original discussion: https://groups.google.com/forum/#!topic/dynamorio-users/kHAyNgzvXuA.

**Description**
This feature request is about supporting raising a signal from code inserted by a clean call. This signal should appear as a signal
naturally raised by OS for the application or by the application itself. This should be correctly detected y debuggers (the point of fault should be found at the specified PC of the instrumented application code). This ticket is limited to scope of Linux / MacOS support.

**How it should look**

```C++
// API
void dr_forge_signal(app_pc pc, int sig);

// Usage
app_pc pc = ...;
int sig = SIGILL;
dr_forge_signal(pc, sig);
```

**Poor man's solution**
A dummy solution is to invoke `int raise(int sig);` from `signal.h`, however this is not "expected" by DynamoRIO core and is not handled properly (especially if DR is built in Debug mode), plus there is no way to deliver correct PC to a debugger.

**Existing functionality**
There already is function `os_forge_exception` which does something similar, but is not exposed via API.

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.