All of lore.kernel.org
 help / color / mirror / Atom feed
* Linux capabilities shouldn't be lost during setuid to non-root from root or to another non-root uid from a non-root uid.
@ 2011-04-17 14:05 crocket
  2011-04-17 18:07 ` Serge E. Hallyn
  0 siblings, 1 reply; 13+ messages in thread
From: crocket @ 2011-04-17 14:05 UTC (permalink / raw)
  To: linux-kernel

Linux capabilities exist to split root previlege to dozens of subsets
of previleges.
But after setuid, all linux capabilities gained from a file are gone for good.
This becomes a problem with OpenVPN.

If I use --mlock option and --user option in OpenVPN, OpenVPN locks
memory with mlockall as root and drops to a non-root user specififed
by --user option.
After dropping to a non-root user, the process loses CAP_IPC_LOCK
capability gained from OpenVPN executable which I personally set.
Because the process doesn't have CAP_IPC_LOCK capability and its UID
isn't 0, further attempts to allocate memory more than "ulimit -l" to
openvpn crash OpenVPN.
This defeats the purpose of linux capabilities.
Linux capabilities exist to give a subset or subsets of previleges to
processes whose UID is greater than 0(root).

Can somebody provide or merge a patch that prevents linux from losing
capabilities after setuid?

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

end of thread, other threads:[~2011-04-20 23:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-17 14:05 Linux capabilities shouldn't be lost during setuid to non-root from root or to another non-root uid from a non-root uid crocket
2011-04-17 18:07 ` Serge E. Hallyn
2011-04-18  1:20   ` crocket
2011-04-18  2:05     ` Serge E. Hallyn
2011-04-18  7:21   ` crocket
2011-04-18  8:28     ` Serge E. Hallyn
2011-04-18 15:02       ` crocket
2011-04-18 22:02         ` Serge E. Hallyn
2011-04-19  1:14           ` crocket
2011-04-19  1:29             ` Serge E. Hallyn
2011-04-19 14:27             ` crocket
2011-04-19 14:35               ` Serge E. Hallyn
2011-04-20 23:51                 ` crocket

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.