Messages in this thread | | | Date | Tue, 14 Aug 2012 18:33:46 +0200 | Subject | Re: How to hack syscall-table, in kernel 2.6+ ? | From | richard -rw- weinberger <> |
| |
On Tue, Aug 14, 2012 at 6:13 PM, Ajay Garg <ajaygargnsit@gmail.com> 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
| |