public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Frustrated with capabilities..
@ 2008-08-27  9:31 Markku Savela
  2008-08-28 14:18 ` Pavel Machek
  0 siblings, 1 reply; 12+ messages in thread
From: Markku Savela @ 2008-08-27  9:31 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-08-29 17:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-27  9:31 Frustrated with capabilities Markku Savela
2008-08-28 14:18 ` Pavel Machek
2008-08-28 14:45   ` Markku Savela
2008-08-28 17:48     ` Theodore Tso
2008-08-28 21:03       ` David P. Quigley
2008-08-29  4:47         ` Casey Schaufler
2008-08-29 14:20           ` David P. Quigley
2008-08-29 10:18       ` Markku Savela
2008-08-29 10:47         ` James Morris
2008-08-29 14:07         ` Theodore Tso
2008-08-29 17:11         ` Serge E. Hallyn
2008-08-29 16:58   ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox