All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karl MacMillan <kmacmillan@mentalrootkit.com>
To: Venkat Yekkirala <vyekkirala@TrustedCS.com>
Cc: Stephen Smalley <sds@epoch.ncsc.mil>,
	Joshua Brindle <jbrindle@tresys.com>,
	Paul Moore <paul.moore@hp.com>,
	latten@austin.ibm.com, jmorris@redhat.com, dwalsh@redhat.com,
	Darrel Goeddel <DGoeddel@TrustedCS.com>,
	Chad Hanson <chanson@TrustedCS.com>,
	selinux@tycho.nsa.gov
Subject: RE: Labeled networking packets
Date: Thu, 21 Sep 2006 12:47:46 -0400	[thread overview]
Message-ID: <1158857266.28640.56.camel@localhost.localdomain> (raw)
In-Reply-To: <36282A1733C57546BE392885C061859201573327@chaos.tcs.tcs-sec.com>

On Thu, 2006-09-21 at 12:27 -0400, Venkat Yekkirala wrote:
> > On Thu, 2006-09-21 at 11:01 -0400, Venkat Yekkirala wrote:
> > > > I agree about what getpeercon should return, even to the point of
> > > > returning nothing or error if only secmark is being used.
> > > 
> > > And why should that be the case? Everything has a label on 
> > a MAC system
> > > and why should apps care about the configuration (explicit 
> > IPSec label
> > > Vs. implicit via secmark)?
> > <snip>
> > > You will want to deal with only 1 label at the app level, 
> > and it should be
> > > the label that was used in determining whether the socket could read
> > > the skb or not.
> > > 
> > > Can you give any examples on where differentiation is needed?
> > 
> > Callers of getpeercon() expect it to return a subject label that they
> > can use in a call to e.g. avc_has_perm() as the source/subject context
> > or setexeccon() or (shudder) setcon().  If it returns
> > httpd_client_packet_lo_t, then the caller is going to run into trouble
> > upon trying to use the context as a subject label.
> 
> Yes, the caller is going to run into trouble here, but only because your
> policy
> is wanting it, is it not? i.e., a trusted app can always work in conjunction
> with policy (via transitions and whatnot if need be) in servicing the
> request
> at the appropriate label.

I doubt it will work in all cases. And returning a label when in fact we
don't have the information (e.g., when only using secmark) changes the
semantics of this call. The call should indicate what information it has
by returning an error without ipsec or netlabel.

I also think this change is confusing which object class we are dealing
with. Packets are a separate object from a process. Yes packets may
inherit the context of the process in some circumstances, but they
remain distinct objects. Making getpeercon return the packet label is
returning the label of the wrong object.

I started to write a long post on scenarios where the distinction would
be important, but honestly I think it comes down to what I said above.
We have two objects and each object should be labeled independently. It
might be possible to use transition rules to combine the information
from the two labels into a third (which is essentially what would be
happening), but it mis-represents the underlying system and is going to
be difficult to manage. It would require an explosion of types to not
lose information (i.e., one type for every possible process / packet
type pair).

The reconciliation scheme currently changes the semantics of both
getpeercon and the new packet object classes in what I see as
non-intuitive ways. Apps and policy will have to take into account which
labeling mechanism is in use (e.g., the packet object class checks will
sometimes get packet types and sometimes get process types - same for
getpeercon). It seems like this will require additional policy and code.

The simplest solution is to keep the labels separate as Josh suggested.
However, I think that it would be better to pass packet and process
labels over ipsec but that would likely be a fundamental change to the
ipsec labeling model.

Karl


--
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:[~2006-09-21 16:48 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-21 16:27 Labeled networking packets Venkat Yekkirala
2006-09-21 16:47 ` Karl MacMillan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-27 19:35 Venkat Yekkirala
2006-09-27 19:15 Joy Latten
2006-09-27 16:46 Venkat Yekkirala
2006-09-27 16:14 Joy Latten
2006-09-26 22:04 Venkat Yekkirala
2006-09-26 22:43 ` James Morris
2006-09-27 11:37   ` Stephen Smalley
2006-09-27 12:40     ` Joshua Brindle
2006-09-27 12:58       ` Stephen Smalley
2006-09-27 13:15         ` Joshua Brindle
2006-09-27 12:59     ` James Morris
2006-09-27 13:29       ` Stephen Smalley
2006-09-27 17:03         ` James Morris
2006-09-27 17:08         ` James Morris
2006-09-26 15:58 Venkat Yekkirala
2006-09-26 15:51 Venkat Yekkirala
2006-09-26 16:47 ` Stephen Smalley
2006-09-26 20:01 ` James Morris
2006-09-25 21:53 Venkat Yekkirala
2006-09-25 22:00 ` James Morris
2006-09-25 21:46 Venkat Yekkirala
2006-09-26 13:35 ` Stephen Smalley
2006-09-25 20:02 Chad Hanson
2006-09-25 20:47 ` Stephen Smalley
2006-09-25 18:56 Chad Hanson
2006-09-25 19:24 ` Stephen Smalley
2006-09-25 15:28 Chad Hanson
2006-09-25 16:41 ` Karl MacMillan
2006-09-25 18:00 ` Stephen Smalley
2006-09-25 14:45 Chad Hanson
2006-09-25 15:54 ` Casey Schaufler
2006-09-22 23:39 Joy Latten
2006-09-22 23:25 Joy Latten
2006-09-22 21:55 Venkat Yekkirala
2006-09-23 14:13 ` Joshua Brindle
2006-09-25 15:35   ` Stephen Smalley
2006-09-25 15:55     ` Joshua Brindle
2006-09-25 16:43       ` Darrel Goeddel
2006-09-25 17:02       ` Stephen Smalley
2006-09-25 18:14         ` Karl MacMillan
2006-09-25 19:58           ` James Morris
2006-09-25 16:35     ` Karl MacMillan
2006-09-25 18:04       ` Stephen Smalley
2006-09-25 18:25         ` Joshua Brindle
2006-09-25 18:41           ` Karl MacMillan
2006-09-25 18:53             ` Joshua Brindle
2006-09-25 19:00             ` Paul Moore
2006-09-25 19:25               ` Stephen Smalley
2006-09-25 19:38                 ` Paul Moore
2006-09-25 19:56                   ` Stephen Smalley
2006-09-25 18:49           ` Stephen Smalley
2006-09-25 19:21             ` Stephen Smalley
2006-09-25 14:59 ` Karl MacMillan
2006-09-25 17:58   ` Stephen Smalley
2006-09-25 18:38     ` Karl MacMillan
2006-09-25 18:54       ` Paul Moore
2006-09-25 20:04     ` James Morris
2006-09-25 20:54       ` James Morris
2006-09-22 21:42 Venkat Yekkirala
2006-09-22 20:30 Venkat Yekkirala
2006-09-22 17:23 Venkat Yekkirala
2006-09-22 17:47 ` Paul Moore
2006-09-22 20:44   ` James Morris
2006-09-22 21:07     ` Paul Moore
2006-09-22 18:52 ` Joshua Brindle
2006-09-22 20:45   ` James Morris
2006-09-22 20:57 ` Stephen Smalley
2006-09-25 14:30   ` Karl MacMillan
2006-09-22 16:14 Venkat Yekkirala
2006-09-22 16:05 Venkat Yekkirala
2006-09-22 16:21 ` Paul Moore
2006-09-22 15:56 Venkat Yekkirala
2006-09-22 16:20 ` Paul Moore
2006-09-22 15:45 Venkat Yekkirala
2006-09-22 16:07 ` Paul Moore
2006-09-22 15:41 Venkat Yekkirala
2006-09-22 15:55 ` Paul Moore
2006-09-22 15:36 Venkat Yekkirala
2006-09-22 15:50 ` Paul Moore
2006-09-22 15:21 Venkat Yekkirala
2006-09-22 15:38 ` Joshua Brindle
2006-09-22 15:15 Venkat Yekkirala
2006-09-22 15:30 ` Paul Moore
2006-09-22 15:09 Venkat Yekkirala
2006-09-22 14:57 Venkat Yekkirala
2006-09-22  0:44 Venkat Yekkirala
2006-09-22  2:04 ` Joshua Brindle
2006-09-22 12:47   ` Stephen Smalley
2006-09-22 13:02     ` Joshua Brindle
2006-09-22 14:47       ` Paul Moore
2006-09-22 14:58         ` Joshua Brindle
2006-09-22 15:25           ` Paul Moore
2006-09-22 19:48             ` James Morris
2006-09-22 19:49           ` Stephen Smalley
2006-09-22 19:02       ` Stephen Smalley
2006-09-22 13:26     ` Karl MacMillan
2006-09-22 13:50       ` Joshua Brindle
2006-09-22 15:01         ` James Morris
2006-09-22 19:17         ` Stephen Smalley
2006-09-22 19:07       ` Stephen Smalley
2006-09-21 17:14 Venkat Yekkirala
2006-09-21 19:37 ` Karl MacMillan
2006-09-21 15:01 Venkat Yekkirala
2006-09-21 15:55 ` Stephen Smalley

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=1158857266.28640.56.camel@localhost.localdomain \
    --to=kmacmillan@mentalrootkit.com \
    --cc=DGoeddel@TrustedCS.com \
    --cc=chanson@TrustedCS.com \
    --cc=dwalsh@redhat.com \
    --cc=jbrindle@tresys.com \
    --cc=jmorris@redhat.com \
    --cc=latten@austin.ibm.com \
    --cc=paul.moore@hp.com \
    --cc=sds@epoch.ncsc.mil \
    --cc=selinux@tycho.nsa.gov \
    --cc=vyekkirala@TrustedCS.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.