From: "Serge E. Hallyn" <serue@us.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: linux-security-module@vger.kernel.org,
Andrew Morton <akpm@osdl.org>,
Stephen Smalley <sds@epoch.ncsc.mil>
Subject: [PATCH 2/2] file capabilities: honor !SECURE_NOROOT
Date: Fri, 8 Dec 2006 13:39:03 -0600 [thread overview]
Message-ID: <20061208193903.GD18566@sergelap.austin.ibm.com> (raw)
In-Reply-To: <20061208193657.GB18566@sergelap.austin.ibm.com>
From: Serge E. Hallyn <serue@us.ibm.com>
Subject: [PATCH 2/2] file capabilities: honor !SECURE_NOROOT
When the SECURE_NOROOT securebit is not set, allow root to
keep it's capabilities over exec, rather than compute the
capabilities based on file capabilities.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
security/commoncap.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/security/commoncap.c b/security/commoncap.c
index fde9695..be86acb 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -202,12 +202,16 @@ #endif
int cap_bprm_set_security (struct linux_binprm *bprm)
{
+ int ret;
+
/* Copied from fs/exec.c:prepare_binprm. */
cap_clear (bprm->cap_inheritable);
cap_clear (bprm->cap_permitted);
cap_clear (bprm->cap_effective);
+ ret = set_file_caps(bprm);
+
/* To support inheritance of root-permissions and suid-root
* executables under compatibility mode, we raise all three
* capability sets for the file.
@@ -225,7 +229,7 @@ int cap_bprm_set_security (struct linux_
cap_set_full (bprm->cap_effective);
}
- return set_file_caps(bprm);
+ return ret;
}
void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe)
--
1.4.1
next prev parent reply other threads:[~2006-12-08 19:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-08 19:36 [PATCH 0/2] file capabilities: two bugfixes Serge E. Hallyn
2006-12-08 19:38 ` [PATCH 1/2] file capabilities: don't do file caps if MNT_NOSUID Serge E. Hallyn
2006-12-08 19:39 ` Serge E. Hallyn [this message]
2006-12-08 20:41 ` [PATCH 0/2] file capabilities: two bugfixes Casey Schaufler
2006-12-08 21:16 ` Serge E. Hallyn
2006-12-08 22:08 ` Casey Schaufler
2006-12-09 0:43 ` Seth Arnold
2006-12-11 21:31 ` Crispin Cowan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061208193903.GD18566@sergelap.austin.ibm.com \
--to=serue@us.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sds@epoch.ncsc.mil \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®