Skip to contentSkip to conversation

capabilites, take 2

PATCH Albert Cahalan 4 participants 11 messages May 14, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Andy Lutomirski

Posix (as interpreted by Linux 2.4/2.6) says:
pP' = (fP & cap_bset) | (fI & pI)

So (assuming that set_security did the "obvious" (but dangerous) thing):

Quoted 8 lines

pP := "task may enable and use these capabilities" pE := "task may use these capabilities _now_" pI := "task may gain these on exec from fI"

fP := "this program gets these caps (module cap_bset)" fI := "this program gets these caps if pI says so"

Which screams "overcomplicated."

People will screw this up.

That you should even have to explain the names as you do is an indication that the names are poor.

Having names that match IRIX names but act differently is a sure path to disaster via confused admins and developers.

Quoted 26 lines

I see no particular invariants here, except for pE <= pP.

IRIX (thanks Valdis) says:

pI' = pI & fI
pP' = fP | (pI' & fP)

Which I interpret as

pP := "task may enable and use these capabilities" pE := "task may use these capabilities _now_" pI := ~"task _loses_ these on exec"

fP := "this program gets these caps"
fI := "this program may keep these caps"

This seems to want pP <= pI as an invariant.

This is what I always thought Linux capabilities meant to be. They don't make my brain hurt.

But I also think they're overengineered. Instead of:

drop_caps_from_inheritable()
exec()

Quoted 8 lines

a program could do:

drop_caps_from_permitted()
exec()

And I can't imagine what use fI != ~0 has, since it's trivially accomplished by a wrapper. It is also trivially bypassed by loading the program manually (with ld.so).

Good point. Even if an exec-only executable would block this, nearly all admins will fail to mark it as such.

Quoted 12 lines

So, in my patch, I decided steal the inheritable mask to mean this:

pI := "this process may gain these caps"
fI := "this is an upper bound on pI"

In other words, if a process is extra-untrusted (e.g. it's a daemon that never needs a certain capability and has no business trying to gain it), it can drop it from pI. Then it cannot try to abuse programs with pP>0. The setuid override is just added paranoia. Another benefit is that it allows a securelevel-like scheme, where even root isn't quite trusted.

Quoted 5 lines

I suppose it might be inappropriate to steal this field like this, given that IRIX already has a (somewhat reasonable) use for it. I have no problem implementing IRIX-style capabilities and (if there is enough interest) adding a _fourth_ process field pM (process maximum capabilities) that does what my pI does.

A few mostly-unrelated thoughts:

Rather than adding a compile-time option or boot option, simply change the syscall numbers and /proc/*/status names. This will cause any existing capability-aware tools to act as if being run on a pre-capability Linux kernel. This seems to be safer than allowing these tools to assume that nothing has changed.

Allow me to mark an executable with a set of capabilities that must be all set or all unset. Default to ~0ull for setuid apps, and to 0ull for all other apps.
Like this:
if ((pFOO & fBAR) != fBAR) pFOO &= ~fBAR;

Before writing the kernel code, how about writing documentation for admins, software developers, and Linux vendors? Until clear and readable documentation exists, this is all just a hazard. You might even make a mistake in the kernel code if it isn't easy for a non-kernel hacker to review how things will interact with their software. Just listing all the cases that need to be reviewed would be an improvement.

This would be an excellent time to reconsider how capabilities are assigned to bits. You're breaking things anyway; you might as well do all the breaking at once. I want local-use bits so that the print queue management access isn't by magic UID/GID. We haven't escaped UID-as-priv if server apps and setuid apps are still making UID-based access control decisions.

#1 lore raw
Quoted 86 lines · Albert Cahalan
Quoted 5 lines · Andy Lutomirski

Posix (as interpreted by Linux 2.4/2.6) says:
pP' = (fP & cap_bset) | (fI & pI)

So (assuming that set_security did the "obvious" (but dangerous) thing):

Quoted 8 lines

pP := "task may enable and use these capabilities" pE := "task may use these capabilities _now_" pI := "task may gain these on exec from fI"

fP := "this program gets these caps (module cap_bset)" fI := "this program gets these caps if pI says so"

Which screams "overcomplicated."

People will screw this up.

That you should even have to explain the names as you do is an indication that the names are poor.

Having names that match IRIX names but act differently is a sure path to disaster via confused admins and developers.

Quoted 26 lines

I see no particular invariants here, except for pE <= pP.

IRIX (thanks Valdis) says:

pI' = pI & fI
pP' = fP | (pI' & fP)

Which I interpret as

pP := "task may enable and use these capabilities" pE := "task may use these capabilities _now_" pI := ~"task _loses_ these on exec"

fP := "this program gets these caps"
fI := "this program may keep these caps"

This seems to want pP <= pI as an invariant.

This is what I always thought Linux capabilities meant to be. They don't make my brain hurt.

But I also think they're overengineered. Instead of:

drop_caps_from_inheritable()
exec()

Quoted 8 lines

a program could do:

drop_caps_from_permitted()
exec()

And I can't imagine what use fI != ~0 has, since it's trivially accomplished by a wrapper. It is also trivially bypassed by loading the program manually (with ld.so).

Good point. Even if an exec-only executable would block this, nearly all admins will fail to mark it as such.

Quoted 12 lines

So, in my patch, I decided steal the inheritable mask to mean this:

pI := "this process may gain these caps"
fI := "this is an upper bound on pI"

In other words, if a process is extra-untrusted (e.g. it's a daemon that never needs a certain capability and has no business trying to gain it), it can drop it from pI. Then it cannot try to abuse programs with pP>0. The setuid override is just added paranoia. Another benefit is that it allows a securelevel-like scheme, where even root isn't quite trusted.

Quoted 5 lines

I suppose it might be inappropriate to steal this field like this, given that IRIX already has a (somewhat reasonable) use for it. I have no problem implementing IRIX-style capabilities and (if there is enough interest) adding a _fourth_ process field pM (process maximum capabilities) that does what my pI does.

Quoted 7 lines

A few mostly-unrelated thoughts:

Rather than adding a compile-time option or boot option, simply change the syscall numbers and /proc/*/status names. This will cause any existing capability-aware tools to act as if being run on a pre-capability Linux kernel. This seems to be safer than allowing these tools to assume that nothing has changed.

That sounds nasty to get right. What about just simulating this for the benefit of old tools:

pP = (what it really is)
pE = (what it really is -- but it will mostly be pP) pI = 0 (or full -- anything else is confusing)

Then capset for on other pids (which currently needs CAP_SETPCAP) goes away completely, since, on stock Linux, that code is unreachable anyway.

I think this emulates the current linux caps quite nicely. Unless we add lots more caps, in which case we'd have to make a guess at what pP is.

Now this code becomes complicated (code-wise, not just conceptually :)

Quoted 6 lines

Allow me to mark an executable with a set of capabilities that must be all set or all unset. Default to ~0ull for setuid apps, and to 0ull for all other apps.
Like this:

   if ((pFOO & fBAR) != fBAR)    pFOO &= ~fBAR;

Once again bypassable by ld.so. What about
if ((pM' & fBAR) != fBAR) ignore fP and setuid
(BINPRM_SEC_NO_ELEVATE)?

I'll call it fR (for required). The default would be:
setuid-root: fR = full
setuid-nonroot and setgid: fR = CAP_SETUID

I check pM' not pP' because in the normal case these capabilities were in fP anyway (except for setgid/setuid-nonroot, in which case the admin probably doesn't want the low-pM task changing its uid). If they weren't, then IMHO it's the job of the task with elevated caps to be careful of what it runs rather than the filesystem.

So we get:

fM: maximum caps for this app and children (default full)
fP: app gains these (subject to fM and pM)
fR: as above

pM: maximum caps for this task and children (full for init)
pP: the usual
pE: the usual

Quoted 8 lines

Before writing the kernel code, how about writing documentation for admins, software developers, and Linux vendors? Until clear and readable documentation exists, this is all just a hazard. You might even make a mistake in the kernel code if it isn't easy for a non-kernel hacker to review how things will interact with their software. Just listing all the cases that need to be reviewed would be an improvement.

Good call. I'll do that.

Quoted 8 lines

This would be an excellent time to reconsider how capabilities are assigned to bits. You're breaking things anyway; you might as well do all the breaking at once. I want local-use bits so that the print queue management access isn't by magic UID/GID. We haven't escaped UID-as-priv if server apps and setuid apps are still making UID-based access control decisions.

How many bits? Or should it even be a bitmask?

I'm thinking either 64 or 128 for kernel-defined caps and either a seperate 128 bits or more or just a list for local-defined.

Then local caps could live in /etc (i don't like it) or /proc (not so nice either) for collision-avoidance.

Or even numbered bits for kernel use and _names_ for user use. You'd do sys_cap_register('printquota') and then that becomes a legal name of a capability. Then you need sys_cap_unregister() to atomically remove it from all tasks.

I'll think about how my maximum mask fits in to all this.

Thanks,
Andy

#3 lore raw
In reply to Albert Cahalan
Quoted 6 lines · Albert Cahalan

This would be an excellent time to reconsider how capabilities are assigned to bits. You're breaking things anyway; you might as well do all the breaking at once. I want local-use bits so that the print queue management access isn't by magic UID/GID. We haven't escaped UID-as-priv if server apps and setuid apps are still making UID-based access control decisions.

Capabilities are a broken model for privilege management; try RBAC/TE instead. http://www.securecomputing.com/pdf/secureos.pdf has notes about the history and comparison of capabilities vs. TE.

Instead of adding new capability bits, replace capable() calls with LSM hook calls that offer you finer granularity both in operation and in object-based decisions, and then use a security module like SELinux to map that to actual permission checks. SELinux provides a framework for defining security classes and permissions, including both definitions used by the kernel and definitions used by userspace policy enforcers (ala security-enhanced X).

Signature · 2 lines
Stephen Smalley <[email protected]>
National Security Agency
#4 lore raw
Quoted 11 lines · Stephen Smalley
Quoted 6 lines · Albert Cahalan

This would be an excellent time to reconsider how capabilities are assigned to bits. You're breaking things anyway; you might as well do all the breaking at once. I want local-use bits so that the print queue management access isn't by magic UID/GID. We haven't escaped UID-as-priv if server apps and setuid apps are still making UID-based access control decisions.

Capabilities are a broken model for privilege management; try RBAC/TE instead. http://www.securecomputing.com/pdf/secureos.pdf has notes about the history and comparison of capabilities vs. TE.

I just read that. It's a very unfair marketing document. Among other things, it suggests that a capability system is stuck with about 40 bits while their own version of capabilities (a duck is a duck...) has 80 bits. Lovely, but not exactly groundbreaking. There is the bit about a 3-argument security call, but a careful reading will reveal that one argument is unused (NULL?) when dealing with abilities like "can set the clock".

About the only thing of interest is that capability transitions can be arbitrary. You're not limited to an obscure set of equations that nobody can agree on. The cost: complicated site-specific config files and the inability to support capability-aware apps that set+clear their own bits.

There is some value in unifying the handling of capability bits with the handling of actor-to-actee security controls. This simplifies the documentation, and thus reduces the likelyhood of admin mistakes.

Quoted 5 lines

Instead of adding new capability bits, replace capable() calls with LSM hook calls that offer you finer granularity both in operation and in object-based decisions, and then use a security module like SELinux to map that to actual permission checks.

Eh, why? That's mostly a search-and-replace on the name, since capable() makes a perfectly fine LSM hook.

Quoted 4 lines

SELinux provides a framework for
defining security classes and permissions, including both definitions used by the kernel and definitions used by userspace policy enforcers (ala security-enhanced X).

Nice.

So what about the old-Oracle problem? You have a server that needs the ability to hog and lock memory. Is there an almost-empty SELinux policy that would provide this while leaving the rest of the system acting as UNIX-like systems have always acted? If so, we have a winner.

One still does need to provide apps with a way to answer "can I do FOO, BAR, and BAZ?" and "am I running with elevated privileges?". Some way to dispose of unneeded privileges would be good too. Hopefully extra libraries wouldn't be needed.

#10 lore raw
In reply to Albert Cahalan
Quoted 6 lines · * Albert Cahalan ([email protected]) wrote:

This would be an excellent time to reconsider how capabilities are assigned to bits. You're breaking things anyway; you might as well do all the breaking at once. I want local-use bits so that the print queue management access isn't by magic UID/GID. We haven't escaped UID-as-priv if server apps and setuid apps are still making UID-based access control decisions.

This is too volatile in stable series.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
#2 lore raw
In reply to Andy Lutomirski
Quoted 11 lines · * Andy Lutomirski ([email protected]) wrote:
Quoted 6 lines

This would be an excellent time to reconsider how capabilities are assigned to bits. You're breaking things anyway; you might as well do all the breaking at once. I want local-use bits so that the print queue management access isn't by magic UID/GID. We haven't escaped UID-as-priv if server apps and setuid apps are still making UID-based access control decisions.

How many bits? Or should it even be a bitmask?

I'm thinking either 64 or 128 for kernel-defined caps and either a seperate 128 bits or more or just a list for local-defined.

Starts to look like the list of LSM callbacks. Making it bigger doesn't help the simple issue, keep one lousy bit across execve(). All this redesign seems wrong to do in 2.6.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
#9 lore raw
In reply to Stephen Smalley
Quoted 12 lines · * Stephen Smalley ([email protected]) wrote:
Quoted 6 lines · Albert Cahalan

This would be an excellent time to reconsider how capabilities are assigned to bits. You're breaking things anyway; you might as well do all the breaking at once. I want local-use bits so that the print queue management access isn't by magic UID/GID. We haven't escaped UID-as-priv if server apps and setuid apps are still making UID-based access control decisions.

Capabilities are a broken model for privilege management; try RBAC/TE instead. http://www.securecomputing.com/pdf/secureos.pdf has notes about the history and comparison of capabilities vs. TE.

Quoted 7 lines

Instead of adding new capability bits, replace capable() calls with LSM hook calls that offer you finer granularity both in operation and in object-based decisions, and then use a security module like SELinux to map that to actual permission checks. SELinux provides a framework for defining security classes and permissions, including both definitions used by the kernel and definitions used by userspace policy enforcers (ala security-enhanced X).

exactly!

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
#5 lore raw
In reply to Albert Cahalan
Quoted 5 lines · Albert Cahalan

I just read that. It's a very unfair marketing document. Among other things, it suggests that a capability system is stuck with about 40 bits while their own version of capabilities (a duck is a duck...) has 80 bits. Lovely, but not exactly groundbreaking.

You missed the point. Capability scheme maps far too many operations to a single capability; CAP_SYS_ADMIN in Linux is a good example. TE model defers organization of operations into equivalence classes to the policy writer.

Quoted 4 lines

There is the bit about
a 3-argument security call, but a careful reading will reveal that one argument is unused (NULL?) when dealing with abilities like "can set the clock".

But very useful when dealing with CAP_DAC_OVERRIDE and friends.

Quoted 3 lines

About the only thing of interest is that capability transitions can be arbitrary. You're not limited to an obscure set of equations that nobody can agree on.

Because there is no one-size-fits-all equation for all transitions.

Quoted 3 lines

The cost: complicated site-specific config files and the inability to support capability-aware apps that set+clear their own bits.

Complexity pushed to userspace, where it can be analyzed appropriately via tools and tailored for the transition in question. Central management of the capabilities based on equivalence classes (types), as opposed to having to manage a distributed nightmare of capability bits on your filesystems. Applications that can transition to other domains, but only if so authorized by the policy.

Quoted 2 lines

Eh, why? That's mostly a search-and-replace on the name, since capable() makes a perfectly fine LSM hook.

It doesn't offer sufficient granularity, either for operation (which you _could_ address by introducing new capabilities, but the hooks are more easily extensible) or for object.

Quoted 6 lines

So what about the old-Oracle problem? You have a server that needs the ability to hog and lock memory. Is there an almost-empty SELinux policy that would provide this while leaving the rest of the system acting as UNIX-like systems have always acted? If so, we have a winner.

See "relaxed policy" or "targeted policy" in recent discussions on the Fedora mailing lists; coming soon to a rawhide near you. Not exactly the same thing (it is a policy where most processes run essentially unconfined except for a targeted set that you define like apache, bind, etc), but you could certainly tweak it to this end (i.e. you put oracle into a domain that gives it the one capability you desire).

Quoted 5 lines

One still does need to provide apps with a way to answer "can I do FOO, BAR, and BAZ?" and "am I running with elevated privileges?". Some way to dispose of unneeded privileges would be good too. Hopefully extra libraries wouldn't be needed.

SELinux provides a policy API already, and a userspace library for accessing it (and caching decisions from it). It also provides (via the AT_SECURE auxv entry) notification that a domain transition has occurred, and this is already used by glibc secure mode. Privileges are dropped via domain transitions.

Signature · 2 lines
Stephen Smalley <[email protected]>
National Security Agency
#6 lore raw
Quoted 10 lines · Stephen Smalley
Quoted 5 lines · Albert Cahalan

I just read that. It's a very unfair marketing document. Among other things, it suggests that a capability system is stuck with about 40 bits while their own version of capabilities (a duck is a duck...) has 80 bits. Lovely, but not exactly groundbreaking.

You missed the point. Capability scheme maps far too many operations to a single capability; CAP_SYS_ADMIN in Linux is a good example.

What I said: lovely, but not exactly groundbreaking.

Suppose we break up CAP_SYS_ADMIN into 41 other bits. There you go. It's silly to argue that a system with more bits is some kind of major advance over one with just a few bits. There is a quality-of-implementation issue here, not some fundamental difference.

Quoted 3 lines

TE model
defers organization of operations into equivalence classes to the policy writer.

I don't see anything special here either. With a plain capability-bit system, you could allow for user-defined aliases that map to multiple bits. In some random /etc config file:

define ADMIN := FOO | BAR | BAZ

Quoted 6 lines
Quoted 4 lines

There is the bit about
a 3-argument security call, but a careful reading will reveal that one argument is unused (NULL?) when dealing with abilities like "can set the clock".

But very useful when dealing with CAP_DAC_OVERRIDE and friends.

I suppose so, but that isn't the interesting case. We already have SELinux for that kind of thing.

Quoted 10 lines
Quoted 3 lines

About the only thing of interest is that capability transitions can be arbitrary. You're not limited to an obscure set of equations that nobody can agree on.

Because there is no one-size-fits-all equation for all transitions.

Quoted 3 lines

The cost: complicated site-specific config files and the inability to support capability-aware apps that set+clear their own bits.

Quoted 6 lines

Complexity pushed to userspace, where it can be analyzed appropriately via tools and tailored for the transition in question. Central management of the capabilities based on equivalence classes (types), as opposed to having to manage a distributed nightmare of capability bits on your filesystems. Applications that can transition to other domains, but only if so authorized by the policy.

Complexity is pushed to admins, most of which are less clueful than one might hope.

Quoted 6 lines
Quoted 2 lines

Eh, why? That's mostly a search-and-replace on the name, since capable() makes a perfectly fine LSM hook.

It doesn't offer sufficient granularity, either for operation (which you _could_ address by introducing new capabilities, but the hooks are more easily extensible) or for object.

SELinux does, I hope, already deal with anything that would involve an "object". So it is of little concern what CAP_DAC_OVERRIDE does. What about setting the clock, hogging memory, using the FIFO scheduler, and so on?

Lack of granularity is an implementation detail. (Blame the SGI folks that wouldn't listen to me.) Lack of granularity is not a design flaw.

Quoted 7 lines
Quoted 6 lines

So what about the old-Oracle problem? You have a server that needs the ability to hog and lock memory. Is there an almost-empty SELinux policy that would provide this while leaving the rest of the system acting as UNIX-like systems have always acted? If so, we have a winner.

Quoted 6 lines

See "relaxed policy" or "targeted policy" in recent discussions on the Fedora mailing lists; coming soon to a rawhide near you. Not exactly the same thing (it is a policy where most processes run essentially unconfined except for a targeted set that you define like apache, bind, etc), but you could certainly tweak it to this end (i.e. you put oracle into a domain that gives it the one capability you desire).

What I'm looking for:

1. configure the kernel by ...
2. ensure that /bin/foo runs early in boot
3. put "blah blah blah" in /etc/foo.conf

That is, is there a small set of simple config files and binaries that I could just slap onto an existing system to ensure that a particular app is granted an extra capability bit?

If yes, then the ugly old-Oracle hack is not needed.

Quoted 11 lines
Quoted 5 lines

One still does need to provide apps with a way to answer "can I do FOO, BAR, and BAZ?" and "am I running with elevated privileges?". Some way to dispose of unneeded privileges would be good too. Hopefully extra libraries wouldn't be needed.

SELinux provides a policy API already, and a userspace library for accessing it (and caching decisions from it). It also provides (via the AT_SECURE auxv entry) notification that a domain transition has occurred, and this is already used by glibc secure mode. Privileges are dropped via domain transitions.

I take that as a "no" then, at least from the viewpoint of a normal app author.

#7 lore raw
Quoted 5 lines · * Albert Cahalan ([email protected]) wrote:
Quoted 3 lines · Stephen Smalley

You missed the point. Capability scheme maps far too many operations to a single capability; CAP_SYS_ADMIN in Linux is a good example.

Quoted 7 lines

What I said: lovely, but not exactly groundbreaking.

Suppose we break up CAP_SYS_ADMIN into 41 other bits. There you go. It's silly to argue that a system with more bits is some kind of major advance over one with just a few bits. There is a quality-of-implementation issue here, not some fundamental difference.

Needing more bits isn't the only problem.

Quoted 10 lines
Quoted 3 lines

TE model
defers organization of operations into equivalence classes to the policy writer.

I don't see anything special here either. With a plain capability-bit system, you could allow for user-defined aliases that map to multiple bits. In some random /etc config file:

define ADMIN := FOO | BAR | BAZ

This doesn't effect the inflexibility of a single definition for domain transistion that's inherent in the capabilty system.

Quoted 3 lines

Lack of granularity is an implementation detail. (Blame the SGI folks that wouldn't listen to me.) Lack of granularity is not a design flaw.

It's a design flaw. More bits won't help. There's an important missing piece...credentials for both subject and object. Both of which can be dynamic, and differ per subject's view of an object.

Quoted 6 lines

What I'm looking for:

1. configure the kernel by ...
2. ensure that /bin/foo runs early in boot
3. put "blah blah blah" in /etc/foo.conf

Quoted 6 lines

That is, is there a small set of simple config files and binaries that I could just slap onto an existing system to ensure that a particular app is granted an extra capability bit?

If yes, then the ugly old-Oracle hack is not needed.

Nearly. There's the minor issue that execve() clears that bit more agressively than desired for non-root processes. Otherwise pam can do it with pam_cap. Which is all we're trying to fix here.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
#8 lore raw
Quoted 8 lines · Chris Wright
Quoted 7 lines · * Albert Cahalan ([email protected]) wrote:
Quoted 3 lines · Stephen Smalley

You missed the point. Capability scheme maps far too many operations to a single capability; CAP_SYS_ADMIN in Linux is a good example.

What I said: lovely, but not exactly groundbreaking.

Quoted 7 lines
Quoted 5 lines

Suppose we break up CAP_SYS_ADMIN into 41 other bits. There you go. It's silly to argue that a system with more bits is some kind of major advance over one with just a few bits. There is a quality-of-implementation issue here, not some fundamental difference.

Needing more bits isn't the only problem.

That's what much of the document went on about. The rest of the document was mostly generic MAC concepts.

Quoted 9 lines
Quoted 9 lines
Quoted 3 lines

TE model
defers organization of operations into equivalence classes to the policy writer.

I don't see anything special here either. With a plain capability-bit system, you could allow for user-defined aliases that map to multiple bits. In some random /etc config file:

Quoted 4 lines
Quoted 1 line

define ADMIN := FOO | BAR | BAZ

This doesn't effect the inflexibility of a single definition for domain transistion that's inherent in the capabilty system.

Sure. I already noted this.

Quoted 7 lines
Quoted 3 lines

Lack of granularity is an implementation detail. (Blame the SGI folks that wouldn't listen to me.) Lack of granularity is not a design flaw.

It's a design flaw. More bits won't help. There's an important missing piece...credentials for both subject and object. Both of which can be dynamic, and differ per subject's view of an object.

There is no meaningful object.

subject: process 12345
object: ??????
operation: lock memory

For a few capability bits, there is a meaningful object and you could use SELinux in place of the capability bits. For most of the capability bits, this is not the case.

Quoted 11 lines
Quoted 11 lines

What I'm looking for:

1. configure the kernel by ...
2. ensure that /bin/foo runs early in boot
3. put "blah blah blah" in /etc/foo.conf

That is, is there a small set of simple config files and binaries that I could just slap onto an existing system to ensure that a particular app is granted an extra capability bit?

Quoted 5 lines
Quoted 1 line

If yes, then the ugly old-Oracle hack is not needed.

Nearly. There's the minor issue that execve() clears that bit more agressively than desired for non-root processes. Otherwise pam can do it with pam_cap. Which is all we're trying to fix here.

Stephen Smalley suggested that SELinux could take the place of our capability bits. So I'm asking how you do that, using the most minimal SELinux config.

If he really has a way, then there is no need to change the execve() behavior in the Linux 2.6.x kernels.

Perhaps we just need an LSM hook to re-add the capability bit after execve() drops it. That's a tiny change that doesn't affect any existing system.