Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out fault inheritance on FreeBSD with krfexec #42

Closed
woodruffw opened this issue Jun 25, 2019 · 0 comments · Fixed by #45
Closed

Figure out fault inheritance on FreeBSD with krfexec #42

woodruffw opened this issue Jun 25, 2019 · 0 comments · Fixed by #45
Assignees
Labels
enhancement New feature or request platform:freebsd

Comments

@woodruffw
Copy link
Member

woodruffw commented Jun 25, 2019

We should come up with a way to have child processes (arbitrarily deep, not just the first level of children) inherit the targeted status of the original krfexec'd parent on FreeBSD.

Some ideas:

  • In our fault wrapper, check whether our current PID is the child of the targeted PID
    • This is cheap for the first level of children, since FreeBSD's struct proc contains p_oppid. For deeper levels we'll probably have to walk up the tree, which would (probably) be too intensive and not very kthread/MP-safe
  • LD_PRELOAD or otherwise wrap fork inside krfexec spawned programs, so that fork checks whether it's the child of a process being faulted and adds the new PID to a set of faulted PIDs
    • This requires us to update the targeting system to allow multiple PIDs, which we should do at some point anyways
  • Maybe something really crazy where we wrap the dynamic linker and put some magic somewhere in the loaded program
  • Maybe a special memory region + a new targeting mode that krfexec uses by default instead? Child processes should inherit things like memory maps, so this might not be too hard to do
  • Similar to the dynamic linker: could we abuse the ELF auxiliary vector for this?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform:freebsd
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants