All of lore.kernel.org
 help / color / mirror / Atom feed
From: Klaus Weidner <klaus@atsec.com>
To: "Christopher J. PeBenito" <cpebenito@tresys.com>
Cc: SELinux Mail List <selinux@tycho.nsa.gov>, joe@nall.com
Subject: Re: MLS directory write constraints
Date: Mon, 20 Aug 2007 15:52:58 -0500	[thread overview]
Message-ID: <20070820205258.GA23508@w-m-p.com> (raw)
In-Reply-To: <1187613297.27524.10.camel@gorn>

On Mon, Aug 20, 2007 at 08:34:57AM -0400, Christopher J. PeBenito wrote:
> After doing some work on some MLS systems last week, I observed some
> constraint denials like this:
> 
> type=AVC msg=audit(1187122358.679:120): avc:  denied  { write } for
> pid=2829 comm="foo" name="run" dev=dm-0 ino=3309608
> scontext=system_u:system_r:foo_t:s15:c0.c1023
> tcontext=system_u:object_r:var_run_t:s0-s15:c0.c1023
> tclass=dir
> 
> Where a daemon has TE rules for creating it's PID file in /var/run, but
> gets denied by this MLS constraint:
> 
> mlsconstrain { file ... dir ... } { write create setattr relabelfrom append unlink link rename mounton }
> 	(( l1 eq l2 ) or
> 	 (( t1 == mlsfilewritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
> 	 (( t2 == mlsfilewriteinrange ) and ( l1 dom l2 ) and ( h1 domby h2 )) or
> 	 ( t1 == mlsfilewrite ) or
> 	 ( t2 == mlstrustedobject ));
> 
> It seems like it should be able to create a file in the directory, since
> the daemon's level is within the range of the directory.

Ranged directories are an information leak in an MLS system, the current
restrictions are intentionally set the way they are to prevent them.

For the CC evaluation of LSPP compliance, we needed to draw a line
between explicit data flows (which need to be enforced by the OS), and
covert channels (which are beyond the scope of the evaluation). 

The method we used to decide this was to check if an interface allows
creation of arbitrary textual/binary data that can be read at another
level - if that's the case, the OS needs to enforce the strict LSPP MLS
constraints and prevent write down. Unfortunately directory write
operations to ranged directories would break this constraint since the
filenames can be chosen arbitrarily and read at lower levels, and this
must not be allowed for untrusted subjects.

You'd need to use one of the subject or object override attributes to
permit this access if you need it - that's what they are there for, and
if you need more granularity it may make sense to define a
"mlswritetorangeddir" attribute to allow only this specific override. For
LSPP compliance, the default behavior for untrusted subjects should
remain not to allow it.

-Klaus

--
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.

  reply	other threads:[~2007-08-20 20:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-20 12:34 MLS directory write constraints Christopher J. PeBenito
2007-08-20 20:52 ` Klaus Weidner [this message]
2007-08-21 13:10   ` Christopher J. PeBenito
2007-08-23 23:05     ` Klaus Weidner
2007-08-24 14:10       ` Christopher J. PeBenito
2007-08-20 21:02 ` Klaus Weidner

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=20070820205258.GA23508@w-m-p.com \
    --to=klaus@atsec.com \
    --cc=cpebenito@tresys.com \
    --cc=joe@nall.com \
    --cc=selinux@tycho.nsa.gov \
    /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.