mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: linux-security-module@vger.kernel.org,
	"Serge E. Hallyn" <serue@us.ibm.com>
Subject: [PATCH 6/6] file capabilities: remove needless (?) bprm_clear_caps calls
Date: Fri, 26 Sep 2008 22:27:50 -0400	[thread overview]
Message-ID: <d57038cdc6b35c2522771e8ed5d5d59ce991a6e1.1222451103.git.serue@us.ibm.com> (raw)
In-Reply-To: <06b2774a667bc535442305193417ff1a479ef1aa.1222451103.git.serue@us.ibm.com>
In-Reply-To: <7004aef68d149ffb4a11835f37469948496ffc18.1222451103.git.serue@us.ibm.com>

Two error conditions at the top of get_file_caps() call
bprm_clear_caps().  However, the bprm capabilities have not
yet been set at this point.

Remove those calls (saving another 16 bytes on vmlinux).

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
 security/commoncap.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index e5afb7c..43bba7a 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -250,15 +250,11 @@ static int get_file_caps(struct linux_binprm *bprm)
 	struct vfs_cap_data vcaps;
 	struct inode *inode;
 
-	if (!file_caps_enabled) {
-		bprm_clear_caps(bprm);
+	if (!file_caps_enabled)
 		return 0;
-	}
 
-	if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID) {
-		bprm_clear_caps(bprm);
+	if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID)
 		return 0;
-	}
 
 	dentry = dget(bprm->file->f_dentry);
 	inode = dentry->d_inode;
-- 
1.5.1.1.GIT


  reply	other threads:[~2008-09-27  2:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-27  2:27 [PATCH 0/6] file capabilities cleanups: introduction Serge E. Hallyn
2008-09-27  2:27 ` [PATCH 1/6] file capabilities: add no_file_caps switch (v3) Serge E. Hallyn
2008-09-27  2:27   ` [PATCH 2/6] file capabilities: remove CONFIG_SECURITY_FILE_CAPABILITIES Serge E. Hallyn
2008-09-27  2:27     ` [PATCH 3/6] file capabilities: uninline cap_safe_nice Serge E. Hallyn
2008-09-27  2:27       ` [PATCH 4/6] file capabilities: clean up setcap code Serge E. Hallyn
2008-09-27  2:27         ` [PATCH 5/6] file capabilities: remove needless inline functions Serge E. Hallyn
2008-09-27  2:27           ` Serge E. Hallyn [this message]
2008-09-27  2:27             ` [PATCH 6/6] file capabilities: remove needless (?) bprm_clear_caps calls Serge E. Hallyn
2008-09-27  2:27               ` Serge E. Hallyn
2008-09-27  4:39           ` [PATCH 5/6] file capabilities: remove needless inline functions Andrew G. Morgan
2008-09-27 13:40             ` Serge E. Hallyn
2008-09-29 21:53               ` Serge E. Hallyn
2008-09-27  4:58         ` [PATCH 4/6] file capabilities: clean up setcap code Andrew G. Morgan
2008-09-27 13:43           ` Serge E. Hallyn
2008-09-27  4:26       ` [PATCH 3/6] file capabilities: uninline cap_safe_nice Andrew G. Morgan
2008-09-27  5:27         ` James Morris
2008-09-27  4:25     ` [PATCH 2/6] file capabilities: remove CONFIG_SECURITY_FILE_CAPABILITIES Andrew G. Morgan

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=d57038cdc6b35c2522771e8ed5d5d59ce991a6e1.1222451103.git.serue@us.ibm.com \
    --to=serue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    /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®