Closed thehajime closed 9 years ago
For the purpose of intercepting syscalls, here is an idea based on ptrace which is built for lightweight containerization: http://proot.me/.
It is possible their work on syscall interception infrastructure can be leveraged https://github.com/cedric-vincent/PRoot/tree/master/src/syscall.
Edit: the advantage of ptrace vs LD_PRELOAD is that no more hassle with setuid and it works with static binary; the disadvantage of ptrace is the interception overhead, trouble with ptrace based debuggers (gdb, strace, etc).
@xlz thanks for the information ! I'm also aware of ptrace-based interception, and had hassling with setuid indeed.
so far, I have no strong reason to choose LD_PRELOAD. and just following a way of how rumpkernel does.
btw, I found an interesting wiki regarding to the performance.
http://wiki.v2.cs.unibo.it/wiki/index.php/System_Call_Interposition:_how_to_implement_virtualization
I pushed rumpserver based system call proxy. 23b73901847e62a88372044e4441f35a6445a182 is the fix.
It still lacks the full feature of proxying, which may be resolved by ptrace in the future. I close this issue and refill other issues for the particular problems.
it's like rumpserver implementation, but a built-in server in NUSE process.