Linux: restricting access to system call?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Linux: restricting access to system call?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Linux: restricting access to system call?  
pascaldamian2@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-22-07 06:20 AM

Can I block access to certain system calls from non-privileged users?
For example, restricting statfs() so normal users would not be able to
see results of 'df' command.

Regards,
Pascal Damian






[ Post a follow-up to this message ]



    Re: Linux: restricting access to system call?  
elsiddik


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-22-07 12:17 PM

On Apr 22, 11:52 am, pascaldami...@gmail.com wrote:
> Can I block access to certain system calls from non-privileged users?
> For example, restricting statfs() so normal users would not be able to
> see results of 'df' command.
>
> Regards,
> Pascal Damian



chmod 700 /bin/df ?

zaher el siddik
http://elsiddik.blogspot.com/






[ Post a follow-up to this message ]



    Re: Linux: restricting access to system call?  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-23-07 12:17 AM

In article <1177223045.629046.81520@y80g2000hsf.googlegroups.com>,
elsiddik <elsiddik@gmail.com> wrote:

> On Apr 22, 11:52 am, pascaldami...@gmail.com wrote: 
>
>
>
> chmod 700 /bin/df ?

The user can simply copy it from another system or recompile it
themselves.  There's no security achieved by removing access to
non-setuid programs.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***





[ Post a follow-up to this message ]



    Re: Linux: restricting access to system call?  
Paul Pluzhnikov


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-23-07 12:17 AM

pascaldamian2@gmail.com writes:

> Can I block access to certain system calls from non-privileged users?

Yes, but not easily.

> For example, restricting statfs() so normal users would not be able to
> see results of 'df' command.

On Linux, you can patch your kernel source to return EACCESS from
sys_statfs() unless 0 == current->uid.

You can probably write a kernel module that will do the above patch
at load time.

You can also add a special interposer library that will return
error from statfs64() unless 0 == getuid() [1], and arrange for
that library to be preloaded everywhere via /etc/ld.so.preload

However this last method is easily bypassed: the user could
statically link his own copy of "df".

Cheers,

[1] better implement your own getuid() via direct syscall.
If you do not, the user can preload his own interposer that answers
0 to getuid(), bypassing your protection using the same trick you
used to implement the protection.
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.





[ Post a follow-up to this message ]



    Re: Linux: restricting access to system call?  
nickf3


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-25-07 06:24 PM

On Apr 21, 9:52 pm, pascaldami...@gmail.com wrote:
> Can I block access to certain system calls from non-privileged users?
> For example, restricting statfs() so normal users would not be able to
> see results of 'df' command.
>
> Regards,
> Pascal Damian

OpenBSD, for example, provides systrace(1) where you can do
all sort of cool things. There's also a shell implemented on top
of that: http://www.monkey.org/~jose/software/stsh/
I'd figure Linux would have something similar/close.
--
Nikolai






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:19 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register