From: Paul Moore <paul.moore@hp.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Eric Paris <eparis@parisplace.org>, selinux@tycho.nsa.gov
Subject: Re: The problem with TUN/TAP devices
Date: Wed, 1 Jul 2009 12:34:51 -0400 [thread overview]
Message-ID: <200907011234.52011.paul.moore@hp.com> (raw)
In-Reply-To: <1246462939.13464.185.camel@moss-pluto.epoch.ncsc.mil>
On Wednesday 01 July 2009 11:42:19 am Stephen Smalley wrote:
> On Wed, 2009-07-01 at 11:19 -0400, Paul Moore wrote:
> > On Wednesday 01 July 2009 11:06:51 am Stephen Smalley wrote:
> > > On Wed, 2009-07-01 at 11:01 -0400, Eric Paris wrote:
> > > > On Wed, Jul 1, 2009 at 9:44 AM, Stephen Smalley<sds@tycho.nsa.gov>
wrote:
> > > > > On Tue, 2009-06-30 at 17:34 -0400, Paul Moore wrote:
> > > > >
> > > > > Wouldn't it be a bug if they didn't match? So I'd add the
> > > > > sk_alloc() hook, set the label/SID for the sock there, and remove
> > > > > the setting of the sock label/SID from post_create. And then just
> > > > > add a BUG_ON to post_create to assert that the inode SID should be
> > > > > the same as the sock SID and if they don't match something has gone
> > > > > wrong.
> > > >
> > > > I've got a system all set up to test anything you want/have/need....
> > > > Maybe this afternoon I'll even give this suggestion a try just to see
> > > > what happens, the networking hooks are ummmm, special?
> > >
> > > Wait - we already have a sk_alloc_security hook.
> >
> > Yep, this is where we would set the sock's label/SID.
> >
> > > And IIRC, we don't set the SID/label there because that can happen when
> > > a new connection sock is created, and thus outside of process context.
> >
> > This gets back to my original comments about "ugliness". New incoming
> > connection sockets should get labeled correctly before use through the
> > inet_conn_request() and inet_csk_clone() hooks. While admittedly, there
> > is the potential for the sock to be labeled incorrectly immediately after
> > allocation, but this is not very different from what we have today (sock
> > is initially labeled with unlabeled_t).
>
> unlabeled_t is easily noticeable in denials (as in this case) and
> correctly reflects the state of the socket - it isn't yet labeled.
> Setting the sid from the task sid of some random task that happens to be
> referenced by current when the new connection is initiated seems a
> little more prone to danger if it happens to not get set by the other
> hooks later.
Well, if we can't do it in sk_alloc() then I think we are stuck with a new
hook; which just seems wrong.
--
paul moore
linux @ hp
--
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.
next prev parent reply other threads:[~2009-07-01 16:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 21:34 The problem with TUN/TAP devices Paul Moore
2009-06-30 22:19 ` James Morris
2009-07-01 15:06 ` Paul Moore
2009-07-01 3:32 ` Casey Schaufler
2009-07-01 15:11 ` Paul Moore
2009-07-01 13:44 ` Stephen Smalley
2009-07-01 15:01 ` Eric Paris
2009-07-01 15:06 ` Stephen Smalley
2009-07-01 15:19 ` Paul Moore
2009-07-01 15:42 ` Stephen Smalley
2009-07-01 16:34 ` Paul Moore [this message]
2009-07-01 22:42 ` James Morris
2009-07-01 22:58 ` Paul Moore
2009-07-01 23:53 ` James Morris
2009-07-02 16:58 ` Paul Moore
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=200907011234.52011.paul.moore@hp.com \
--to=paul.moore@hp.com \
--cc=eparis@parisplace.org \
--cc=sds@tycho.nsa.gov \
--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.