Re: Intercepting system calls

From: Gaurav Saxena
Date: Fri Dec 23 2011 - 04:38:24 EST


On Fri, Dec 23, 2011 at 2:56 PM, richard -rw- weinberger
<richard.weinberger@xxxxxxxxx> wrote:
> On Fri, Dec 23, 2011 at 10:22 AM, Gaurav Saxena <grvsaxena419@xxxxxxxxx> wrote:
>> Hello Richard
>>
>> On Fri, Dec 23, 2011 at 2:46 PM, richard -rw- weinberger
>> <richard.weinberger@xxxxxxxxx> wrote:
>>> On Fri, Dec 23, 2011 at 10:08 AM, Gaurav Saxena <grvsaxena419@xxxxxxxxx> wrote:
>>>> Ok I have seen details of KPROBES, I think it will suit to my
>>>> requirements, I just wanted to know a few things,
>>>> Can I use probes to prevent unlink of certain files? Also is
>>>> CONFIG_KPROBES set to "y" on linux kernels available with distros like
>>>> ubuntu?
>>>
>>> Kprobes allow you to instrument the kernel.
>>> AFAIK it enabled by most distros.
>> Can I use probes to return immediately ie. without execution of
>> original system call. For example I put a entry probe on unlink and
>> then on the probe return value unlink code is executed or not. Is that
>> possible ?
>> Also can I call a userspace function from kernel code? Would that be insecure ?
>
> Using Kprobes you can do nearly anything.
As I go through the documentation, it says execution of system call
does not depend upon the return value of probe, then how could I stop
the system call from being executed? I don't want to use wild jumps.
> But I would be surprised if you find a acceptable and sane solution.
Why is tinkering around system calls so insane? I think SELinux and
some other projects offer some such options but they have patches
which involves recompiling/reinstalling the kernel to use them,
Couldn't there be any sane method with current kernel which could make
this work. Is this done for security ?
>
> --
> Thanks,
> //richard



--
Thanks and Regards ,
Gaurav
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/