[lkml]   [2001]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: capabilities carried over execve()

> 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
> patch.
> - exec the child in a stopped state, mess with caps, then
> send it SIGCONT. AFAIK, there is no way to do
> execve_and_stop.

What about ptrace? It should be able to do this kind of stuff... but
it is going to be messy.
I'm "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at
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

 \ /
  Last update: 2005-03-22 12:52    [W:0.037 / U:4.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site