public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	"Stephen D. Smalley" <sds@tycho.nsa.gov>,
	James Morris <jmorris@namei.org>,
	Florian Mickler <florian@mickler.org>
Subject: [3/8] selinux: use default proc sid on symlinks
Date: Tue, 24 Aug 2010 15:16:56 -0700	[thread overview]
Message-ID: <20100824221820.328044232@clark.site> (raw)
In-Reply-To: <20100824224631.GA5458@kroah.com>

2.6.27-stable review patch.  If anyone has any objections, please let us know.

------------------
Content-Length: 1197
Lines: 32

From: Stephen Smalley <sds@tycho.nsa.gov>

commit ea6b184f7d521a503ecab71feca6e4057562252b upstream.

As we are not concerned with fine-grained control over reading of
symlinks in proc, always use the default proc SID for all proc symlinks.
This should help avoid permission issues upon changes to the proc tree
as in the /proc/net -> /proc/self/net example.
This does not alter labeling of symlinks within /proc/pid directories.
ls -Zd /proc/net output before and after the patch should show the difference.

Signed-off-by:  Stephen D. Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Cc: Florian Mickler <florian@mickler.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 security/selinux/hooks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1290,7 +1290,7 @@ static int inode_doinit_with_dentry(stru
 		/* Default to the fs superblock SID. */
 		isec->sid = sbsec->sid;
 
-		if (sbsec->proc) {
+		if (sbsec->proc && !S_ISLNK(inode->i_mode)) {
 			struct proc_inode *proci = PROC_I(inode);
 			if (proci->pde) {
 				isec->sclass = inode_mode_to_security_class(inode->i_mode);



  parent reply	other threads:[~2010-08-24 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 22:46 [0/8] 2.6.27.53-stable review Greg KH
2010-08-24 22:16 ` [1/8] ARM: Tighten check for allowable CPSR values Greg KH
2010-08-24 22:16 ` [2/8] kbuild: fix make incompatibility Greg KH
2010-08-24 22:16 ` Greg KH [this message]
2010-08-24 22:16 ` [4/8] can: add limit for nframes and clean up signed/unsigned variables Greg KH
2010-08-24 22:16 ` [5/8] fixes for using make 3.82 Greg KH
2010-08-24 22:16 ` [6/8] drm: stop information leak of old kernel stack Greg KH
2010-08-24 22:17 ` [7/8] USB: add device IDs for igotu to navman Greg KH
2010-08-24 22:17 ` [8/8] USB: io_ti: check firmware version before updating Greg KH

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=20100824221820.328044232@clark.site \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=florian@mickler.org \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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