Skip to content
This repository has been archived by the owner on Dec 30, 2021. It is now read-only.

How to expose exit_group events in reverie #73

Open
rrnewton opened this issue Mar 10, 2020 · 0 comments
Open

How to expose exit_group events in reverie #73

rrnewton opened this issue Mar 10, 2020 · 0 comments

Comments

@rrnewton
Copy link
Collaborator

The exit_group syscall, as discussed in this dettrace issue provides a challenging case for the separation of concerns in Reveries design. That is, Reverie strives to be the interception/instrumentation layer only, separate from any higher level tools that provide kernel-like functionality, but to handle exit_group correctly may require significant emulation and replacement of Linux functionality, which is not Reverie's job.

The problem comes from the fact that exit_group and ptrace don't mix well [1]. A Reverie guarantee should be that it detects exit events for every thread. If ptrace gets into a messed state where it can't reliably tell if a thread has exited, that undermines this goal.

Intercept exit_group but don't inject it

This essentially forces the tool sitting above Reverie to emulate exit group, because it can't inject it back into the guest, and therefore can never actually execute exit_group in the kernel.

Alternative: Emulate/hide exit_group at the Reverie level

Another possibility is that Reverie itself tracks enough information that it can essentially "expand" exit group into a series of individual, asynchronous thread exit events. The problem with this is that it takes away any ability of the tool to control when these exits occur (unless the tool is fully sequentializing scheduling).

Other References:

When any thread executes exit_group syscall, every tracee in its thread
group reports its death to its tracer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant