LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
Cc: James Morris <jmorris@namei.org>,
	Eric Paris <eparis@parisplace.org>,
	Nick Piggin <npiggin@kernel.dk>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH] security/selinux: fix /proc/sys/ labeling
Date: Tue, 01 Feb 2011 11:37:26 -0500	[thread overview]
Message-ID: <1296578246.12605.22.camel@moss-pluto> (raw)
In-Reply-To: <AANLkTi=wAXO0+gC=Cvh8EcJKOQW6-LSuO_tm2MsrtQQ6@mail.gmail.com>

On Tue, 2011-02-01 at 18:32 +0200, Lucian Adrian Grijincu wrote:
> On Tue, Feb 1, 2011 at 5:59 PM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> >> Just the earlier one. I added his sign-off because of this paragraph
> >> in SubmittingPatches:
> >> | The Signed-off-by: tag indicates that the signer was involved in the
> >> | development of the patch, or that he/she was in the patch's delivery path.
> 
> 
> So should I leave Eric's sign-off here?

I guess so, given that paragraph.

> >> Without we label all nodes in /proc/ through selinux_proc_get_sid.
> >>
> >> /proc/1/limits should not get it's sid from here, but from
> >> security_task_to_inode -> selinux_task_to_inode.
> >>
> >> Without the check we send "/1/limits" to selinux_proc_get_sid, which
> >> strips off "/1" leaving "/limits". This will be labeled with "proc_t"
> >> IIRC.
> >
> > Are you sure?  Those inodes should be labeled by proc_pid_make_inode()
> > -> security_task_to_inode() -> selinux_task_to_inode(), which will set
> > the inode SID to match the associated task SID, and set the
> > isec->initialized flag.  Then when inode_doinit_with_dentry gets called
> > later, it should bail immediately due to isec->initialized already being
> > set.
> 
> 
> 
> I'll post an updated patch without those checks. I tested and 'find
> /proc | xargs ls -Z' said the same thing with and without those
> checks.
> 
> I remember doing the same test yesterday and saw some differences, but
> I must have compared the wrong files.

Ok, good.  That gets rid of the last vestige of proc implementation
details in selinux.

-- 
Stephen Smalley
National Security Agency


  reply	other threads:[~2011-02-01 16:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01  0:17 Lucian Adrian Grijincu
2011-02-01  1:32 ` [PATCH] security: remove unused security_sysctl hook Lucian Adrian Grijincu
2011-02-01 15:02 ` [PATCH] security/selinux: fix /proc/sys/ labeling Stephen Smalley
2011-02-01 15:53   ` Lucian Adrian Grijincu
2011-02-01 15:59     ` Stephen Smalley
2011-02-01 16:32       ` Lucian Adrian Grijincu
2011-02-01 16:37         ` Stephen Smalley [this message]
2011-02-01 16:42           ` [PATCH 1/2] " Lucian Adrian Grijincu
2011-02-01 16:44             ` [PATCH 2/2] security: remove unused security_sysctl hook Lucian Adrian Grijincu
2011-02-01 19:05               ` Stephen Smalley
2011-02-01 20:06                 ` Eric Paris
2011-02-14 19:33                   ` Lucian Adrian Grijincu
2011-02-14 19:53                     ` Eric Paris
2011-02-14 20:06                       ` Lucian Adrian Grijincu
2011-02-14 22:06                         ` James Morris
2011-02-01 19:04             ` [PATCH 1/2] security/selinux: fix /proc/sys/ labeling Stephen Smalley
2011-02-01 19:33             ` Eric W. Biederman
2011-02-01 19:33             ` Eric W. Biederman
2011-02-01 19:46               ` Lucian Adrian Grijincu
2011-02-01 20:14                 ` Eric W. Biederman

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=1296578246.12605.22.camel@moss-pluto \
    --to=sds@tycho.nsa.gov \
    --cc=ebiederm@xmission.com \
    --cc=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=lucian.grijincu@gmail.com \
    --cc=npiggin@kernel.dk \
    --subject='Re: [PATCH] security/selinux: fix /proc/sys/ labeling' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).