diff options
author | Serge E. Hallyn <serue@us.ibm.com> | 2009-04-02 18:47:14 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-04-03 11:49:31 +1100 |
commit | b5f22a59c0356655a501190959db9f7f5dd07e3f (patch) | |
tree | 3c20437a6a3b7b7e980078bfbcd0d53cdeda7528 /fs/omfs/file.c | |
parent | 3d43321b7015387cfebbe26436d0e9d299162ea1 (diff) |
don't raise all privs on setuid-root file with fE set (v2)
Distributions face a backward compatibility problem with starting to use
file capabilities. For instance, removing setuid root from ping and
doing setcap cap_net_raw=pe means that booting with an older kernel
or one compiled without file capabilities means ping won't work for
non-root users.
In order to replace the setuid root bit on a capability-unaware
program, one has to set the effective, or legacy, file capability,
which makes the capability effective immediately. This patch
uses the legacy bit as a queue to not automatically add full
privilege to a setuid-root program.
So, with this patch, an ordinary setuid-root program will run with
privilege. But if /bin/ping has both setuid-root and cap_net_raw in
fP and fE, then ping (when run by non-root user) will not run
with only cap_net_raw.
Changelog:
Apr 2 2009: Print a message once when such a binary is loaded,
as per James Morris' suggestion.
Apr 2 2009: Fix the condition to only catch uid!=0 && euid==0.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/omfs/file.c')
0 files changed, 0 insertions, 0 deletions