Frustrated with capabilities..

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Markku Savela
Date: Wednesday, August 27, 2008 - 2:31 am

I just want to run an exectable with limited capabilities and assumed
the following approach would work fine:

 1) fork process
 2) in child

    2.1 set current capabilities (eip) using cap_set_proc
    2.2 execve the executable.

But it frigging does not work! Just before the execve, the result of
cap_to_text is

    = cap_net_bind_service+eip

but, in the execve executable, the result is suddenly

    = cap_net_bind_service+i

Why does the execve clear the effective and permitted capabities,
against my clear instructions? (I also have the prctl KEEP_CAPS set,
though in this case it should be irrelevant).

- The kernel is from ubuntu distro, 2.6.24.

- the executable *does* *not* have any setuid/setgid bits

- the upcoming file capabities will not be any help, because I will
  need to start the same executable with different capabilities
  depending on context.

If this is not a bug in kernel, it is a misdesign, which makes the
obvious use of cap_set_proc rather useless...

-- 
Markku Savela
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Frustrated with capabilities.., Markku Savela, (Wed Aug 27, 2:31 am)
Re: Frustrated with capabilities.., Pavel Machek, (Thu Aug 28, 7:18 am)
Re: Frustrated with capabilities.., Markku Savela, (Thu Aug 28, 7:45 am)
Re: Frustrated with capabilities.., Theodore Tso, (Thu Aug 28, 10:48 am)
Re: Frustrated with capabilities.., David P. Quigley, (Thu Aug 28, 2:03 pm)
Re: Frustrated with capabilities.., Casey Schaufler, (Thu Aug 28, 9:47 pm)
Re: Frustrated with capabilities.., Markku Savela, (Fri Aug 29, 3:18 am)
Re: Frustrated with capabilities.., James Morris, (Fri Aug 29, 3:47 am)
Re: Frustrated with capabilities.., Theodore Tso, (Fri Aug 29, 7:07 am)
Re: Frustrated with capabilities.., David P. Quigley, (Fri Aug 29, 7:20 am)
Re: Frustrated with capabilities.., Serge E. Hallyn, (Fri Aug 29, 9:58 am)
Re: Frustrated with capabilities.., Serge E. Hallyn, (Fri Aug 29, 10:11 am)