【发布时间】:2014-04-26 13:20:48
【问题描述】:
我正在尝试在 linux x86_32 上挂钩套接字系统调用。此系统调用不存在,但通过 socketcall 进行门控。
man socketcall:socketcall() is a common kernel entry point for the socket system calls. call determines which socket function to invoke. args points to a block containing the actual arguments, which are passed through to the appropriate call.
我用我自己的函数连接了这个系统调用(__NR_socketcall 在我的系统上是 102,在 http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html 上也有说明),它打印一些东西并在之后调用原始函数。但是,我的函数永远不会被调用。此外,strace 显示调用了 socket() 系统调用。
基本问题:如何在 linux x86_32 上挂钩套接字系统调用?
子问题:为什么 strace 显示的是 socket() 系统调用而不是 socketcall()?
在存在套接字系统调用的 x86_64 上一切正常。
【问题讨论】: