|
From: Filipe C. <fi...@gm...> - 2009-04-01 07:37:13
|
Hi,
I'm implementing some Darwin syscalls but I'm having a small problem...
There's a system call that related to code signing. I want to disable
the call if the parameters are such and such. Otherwise, I get the
current process (valgrind) marked as "KILL if invalid" and, of course,
marked as invalid (the code that is running is not the signed code).
I already implemented the handling of the required fcntl to add the code
signatures and the system call itself (#169, csops).
How can I bypass the system call if the parameters are such and such?
something like:
PRE(...)
{
...
if (ARG2 == VKI_KILL_IF_INVALID)
dont_execute_syscall();
...
}
Thanks in advance,
Filipe Cabecinhas
|
|
From: Nicholas N. <n.n...@gm...> - 2009-04-01 14:36:17
|
On Wed, Apr 1, 2009 at 2:37 AM, Filipe Cabecinhas <fi...@gm...> wrote:
>
> How can I bypass the system call if the parameters are such and such?
>
> something like:
> PRE(...)
> {
> ...
> if (ARG2 == VKI_KILL_IF_INVALID)
> dont_execute_syscall();
> ...
> }
I think you want the SET_STATUS_{Success,Failure,from_SysRes} macros
in coregrind/m_syswrap/priv_types_n_macros.h. They're used in various
places, eg. the wrapper for exit().
Nick
|