Re: How to hack syscall-table, in kernel 2.6+ ?

From: richard -rw- weinberger
Date: Tue Aug 14 2012 - 12:33:41 EST


On Tue, Aug 14, 2012 at 6:13 PM, Ajay Garg <ajaygargnsit@xxxxxxxxx> wrote:
> So, the use-case I am trying to solve, is that only a particular
> process should be able to read a group of files, and no one else (i.e.
> no-other-user/ no-other-process/no-other-anything). The only exception
> is the "root" user, and any user holding "sudo" previleges.
>
> So, only a particular process (with a specified PID), the superuser,
> and any user-carrying-sudo previleges, should be able to read a group
> of files.

Sounds like a use case for a LSM (like SELinux).

Let's suppose you hook open().
Your code will notice open("/bin/foo/", ...)
But you cannot just filter for /bin/foo, you have to know much more context.
What's the current tasks root directory? Which namespace, etc.
Of course you can gather all this information but it will make your
code large and buggy.

--
Thanks,
//richard
--
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/