From: Paul Moore <paul.moore@hp.com>
To: Trent Jaeger <tjaeger@cse.psu.edu>
Cc: Eric Paris <eparis@redhat.com>,
Stephen Smalley <sds@tycho.nsa.gov>,
selinux@tycho.nsa.gov, James Morris <jmorris@namei.org>,
Eric Paris <eparis@parisplace.org>
Subject: Re: Socket and inode label consistency
Date: Wed, 27 Aug 2008 14:34:04 -0400 [thread overview]
Message-ID: <200808271434.04677.paul.moore@hp.com> (raw)
In-Reply-To: <5680A933-013B-413E-8012-BD843F8C22BE@cse.psu.edu>
On Wednesday 27 August 2008 2:20:48 pm Trent Jaeger wrote:
> On Aug 27, 2008, at 2:05 PM, Eric Paris wrote:
> >> Hi,
> >>
> >>
> >> What we want is to create a socket within the context of a
> >> multilevel secure process. For example, if the process has an MLS
> >> range of s0-s1, we may want an s0 or s1 socket.
> >>
> >>
> >> Thus, in theory, we should be able to avoid dealing with context
> >> changes on connected sockets and such. Once the socket goes into
> >> any use, it cannot be relabeled.
> >>
> >>
> >> I am not sure that setxattr will work as this is an inode
> >> operation, and I do not see a reference from an inode to an
> >> associated socket.
> >>
> >>
> >> Originally, I was thinking of setsockopt, but I agree that it
> >> would be
> >> nice to deal with it via the file interface, like fsetfilecon.
> >
> > /proc/self/attr/sockcreate and I know I wrote some libselinux stuff
> > around it too....
>
> OK. We'll take a look.
Yeah, as others have said setsockcreatecon() is your friend here. If
you need a working example there is a test utility included in the
audit-test project on sourceforge[1] which uses setsockcreatecon() to
create some strangely labeled sockets. If you download the audit-test
sources the tool can be found in utils/network-server; it isn't the
prettiest piece of code but it works ;)
If you have any questions or problems don't hesitate to ask.
[1] http://sourceforge.net/projects/audit-test
--
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:[~2008-08-27 18:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 0:50 Socket and inode label consistency Trent Jaeger
2008-08-27 11:57 ` Stephen Smalley
2008-08-27 15:49 ` Paul Moore
2008-08-27 18:08 ` Trent Jaeger
2008-08-27 18:05 ` Eric Paris
2008-08-27 18:20 ` Trent Jaeger
2008-08-27 18:34 ` Paul Moore [this message]
2008-08-27 20:15 ` Trent Jaeger
2008-08-27 18:16 ` Stephen Smalley
2008-08-27 18:32 ` Trent Jaeger
2008-08-27 20:06 ` Casey Schaufler
2008-08-27 20:32 ` Paul Moore
2008-08-27 21:38 ` Trent Jaeger
2008-08-27 22:53 ` Casey Schaufler
2008-08-28 12:13 ` Stephen Smalley
2008-08-28 15:20 ` Trent Jaeger
2008-08-29 4:22 ` Casey Schaufler
2008-08-29 12:13 ` Stephen Smalley
2008-08-29 17:34 ` Trent Jaeger
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=200808271434.04677.paul.moore@hp.com \
--to=paul.moore@hp.com \
--cc=eparis@parisplace.org \
--cc=eparis@redhat.com \
--cc=jmorris@namei.org \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=tjaeger@cse.psu.edu \
/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.