capabilities carried over execve()

From: Eric Buddington (
Date: Tue Apr 24 2001 - 09:45:18 EST

I am attempting to write an init replacement that is capability-smart.
Though I'm pleased that prctl() lets me keep capabilities across a
setreuid(), maintaining caps over execve() seems impossible to do right.

I currently see a few options:
        - use the CLOEXEC-pipe hack that execcap uses (parent notices
          when pipe closes then rushes to set caps on child before
          child notices they're gone). This looks like a race to me.
        - tweak linux/fs/exec.c (prepare_binprm) to pretend that all
          files have cap_inheritable and cap_effective fully set.
          This seems a more elegant solution, but requires a kernel
        - exec the child in a stopped state, mess with caps, then
          send it SIGCONT. AFAIK, there is no way to do

Is there a better solution available, or one in the works?
I think capabilites may be a key to achieving Pretty Good (tm) security
- but then again, so is running bind as non-root, and nobody even
bothers to do that...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:11 EST