All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell Coker <rcoker@redhat.com>
To: Stephen Smalley <sds@epoch.ncsc.mil>
Cc: Daniel J Walsh <dwalsh@redhat.com>,
	SE Linux list <selinux@tycho.nsa.gov>,
	Joshua Brindle <jbrindle@snu.edu>,
	Jim Carter <jwcart2@epoch.ncsc.mil>,
	Colin Walters <walters@redhat.com>,
	Nalin Dahyabhai <nalin@redhat.com>
Subject: Re: Single home directory type for all roles.
Date: Fri, 10 Dec 2004 06:08:37 +1100	[thread overview]
Message-ID: <1102619317.4509.61.camel@aeon> (raw)
In-Reply-To: <1102616319.32175.184.camel@moss-spartans.epoch.ncsc.mil>

On Thu, 2004-12-09 at 13:18 -0500, Stephen Smalley wrote:
> On Thu, 2004-12-09 at 13:12, Russell Coker wrote:
> > Last time I mentioned this I was informed that it is impractically
> > difficult for the kernel code to differentiate between an application
> > such as ls calling readlink(2) and the kernel code calling it as part of
> > a file open operation.
> 
> Not sure who said that, but there are two separate LSM hooks on those
> code paths, security_inode_readlink() vs. security_inode_follow_link(). 
> They just happen to perform the same check in SELinux presently. 
> Whether or not it is legitimate to separate them in the access control
> model is another question; if you don't want the admin following the
> link, why do you want an application he runs to rely on the information
> returned by readlink?

You are correct that there are cases of applications calling readlink(2)
for the purpose of canonicalising a path which would be vulnerable to
race conditions after such a change.  However writing an application
that does such things in a manner such that it is not vulnerable to any
race conditions is really difficult and it seems likely that most such
applications can be attacked in other ways (which will be more difficult
to implement).

But it would catch the majority of attacks and make it more difficult
for an attack to leave a file system.  Some of the attacks might work if
the attacker found a symlink in a directory that they could rename - but
the attacker would need to discover the contents of the sym-link which
should be impossible.

> In any event, we could apply different permission checks - it just
> requires defining a new permission in the lnk_file class and modifying
> the selinux_inode_follow_link() hook function to use it.  Trivial patch,
> anyone could do it (but then you would need to identify all the places
> in the policy where you would need to add it).

Fixing the policy should be easy enough.

> > The solution then would be to have a separate domain for the
> > administrator to run ls which can read all sym-links while other
> > programs the administrator may run (rm, cp, mv, etc) will be denied
> > access to read many types of sym-link.  Is this a good idea?
> 
> Seems painful.

Yes.  But it would give a practical use for ls_exec_t.  ;)

> > Can we break the tradition of having only /home/$USER in this regard?
> > There are several other categories of files that are relevant to
> > security that could benefit from similar treatment if we go down that
> > path.
> 
> For MLS, we'll need multiple home directories per user anyway, although
> they could all be rooted under /home/$USER and polyinstantiated
> directories could be used to transparently redirect to the right member
> subdirectory.

That's an entirely different issue.

If we have both strict policy in it's current form and MLS then we would
have two ways of categorising the files (role and level).  I think that
probably the best thing to do for MLS is to polyinstantiate /home per
MLS level.  Anything else seems to get too confusing too fast.

I hope that we don't plan on supporting polyinstantiation for MLS over
NFS.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  parent reply	other threads:[~2004-12-09 19:08 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-07  0:08 patch: add can_create() macro, allow file_type_auto_trans(a,b,c, { file dir }) Thomas Bleher
2004-12-08 19:32 ` James Carter
2004-12-09 16:31   ` Some more fixes Daniel J Walsh
2004-12-09 18:35     ` Thomas Bleher
2004-12-10 20:14     ` James Carter
2004-12-09 16:50   ` Single home directory type for all roles Daniel J Walsh
2004-12-09 17:20     ` Stephen Smalley
2004-12-09 17:40       ` Stephen Smalley
2004-12-10 16:23         ` Manipulating user roles without policy-sources installed Daniel J Walsh
2004-12-10 16:37           ` Stephen Smalley
2004-12-10 18:09             ` Daniel J Walsh
2004-12-10 18:38             ` Stephen Smalley
2004-12-09 17:47       ` Single home directory type for all roles Russell Coker
2004-12-09 17:53         ` Stephen Smalley
2004-12-09 18:12           ` Russell Coker
2004-12-09 18:18             ` Stephen Smalley
2004-12-09 18:45               ` Stephen Smalley
2004-12-09 19:08               ` Russell Coker [this message]
2004-12-09 20:03             ` Casey Schaufler
2004-12-10 12:20               ` Russell Coker
2004-12-10 15:22                 ` Valdis.Kletnieks
2004-12-10 16:19                   ` Casey Schaufler
2004-12-10 17:00                     ` Valdis.Kletnieks
2004-12-10 17:06                       ` Stephen Smalley
2004-12-10 17:29                       ` Casey Schaufler
2004-12-09 20:40             ` Valdis.Kletnieks
2004-12-10  3:03               ` Russell Coker
2004-12-10 14:09                 ` Daniel J Walsh
2004-12-10 14:31                   ` Stephen Smalley
2004-12-10 15:43                   ` Colin Walters
2004-12-10 16:33                   ` Casey Schaufler
2004-12-13 13:25                   ` Russell Coker
2004-12-13 13:56                     ` Daniel J Walsh
2004-12-13 14:19                       ` Russell Coker
2004-12-09 19:07           ` Thomas Bleher
2004-12-09 19:19             ` Russell Coker
2004-12-09 17:28     ` Colin Walters
2004-12-09 18:02       ` Russell Coker
2004-12-09 19:45         ` Daniel J Walsh
2004-12-09 20:07           ` Stephen Smalley
2004-12-09 20:13           ` Russell Coker
2004-12-09 20:22             ` Daniel J Walsh
2004-12-09 20:30               ` Russell Coker
2004-12-09 21:38               ` Thomas Bleher
2004-12-10  2:56                 ` Russell Coker
2004-12-09 22:29               ` Colin Walters
2004-12-10 13:11                 ` Stephen Smalley
2004-12-10 16:28                   ` Colin Walters
2004-12-09 21:16           ` Thomas Bleher
2004-12-10  2:58             ` Russell Coker
2004-12-09 22:43         ` Colin Walters
2004-12-10  2:23           ` Russell Coker
2004-12-10 15:48             ` Colin Walters
2004-12-10 21:58               ` Luke Kenneth Casson Leighton
2004-12-09 19:38       ` Daniel J Walsh
2004-12-09 19:58         ` Stephen Smalley
2004-12-09 20:09           ` Daniel J Walsh
2004-12-09 20:17         ` Russell Coker
2004-12-09 20:38           ` Daniel J Walsh
  -- strict thread matches above, loose matches on Subject: below --
2004-12-09 18:50 Alex Ackerman
2004-12-09 19:29 ` Russell Coker

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=1102619317.4509.61.camel@aeon \
    --to=rcoker@redhat.com \
    --cc=dwalsh@redhat.com \
    --cc=jbrindle@snu.edu \
    --cc=jwcart2@epoch.ncsc.mil \
    --cc=nalin@redhat.com \
    --cc=sds@epoch.ncsc.mil \
    --cc=selinux@tycho.nsa.gov \
    --cc=walters@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.