All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: Stephen Smalley <sds@epoch.ncsc.mil>
Cc: Joshua Brindle <method@gentoo.org>,
	SE-Linux <selinux@tycho.nsa.gov>,
	James Morris <jmorris@redhat.com>,
	Daniel J Walsh <dwalsh@redhat.com>
Subject: Re: temporary hack to use udev in selinux
Date: Thu, 29 Jul 2004 14:53:12 +0100	[thread overview]
Message-ID: <20040729135312.GA8858@lkcl.net> (raw)
In-Reply-To: <1091105008.21971.17.camel@moss-spartans.epoch.ncsc.mil>

On Thu, Jul 29, 2004 at 08:43:28AM -0400, Stephen Smalley wrote:

> > that should patch cleanly into 2.6.7, but I'd like to note that at this 
> > point udev is braindead wrt SELinux.
> > Once upon a time udev had selinux support integrated so that setfscreate 
> > was called to set the context of the devices being written however it 
> > was changed at some point to make SELinux an after device creation addon 
> > script which makes it label the devices after they are created. Because 
> > of this Hardened Gentoo has decided not to support udev at this time.
> 
> I haven't tried udev myself, but I think Dan has used it successfully
> with SELinux.  

 also i've successfully got it to work under Debian (unstable) with
 my lovely 2.6.6-selinux1 kernel.

 i had to modify the file_contexts/types.fc file to that
 /.?u?dev/.... on every line because without that, if you
 run make relabel, it destroys all the permissions in the
 "old" /dev (which are remapped to /.dev when udev has control
 of /dev) and consequently you can't boot the machine [the "old"
 /dev is used on boot, of course, prior to udev being run].


 i don't know what dan has done, nor what fedora does, whether
 they use /udev for what debian uses /.dev for.

 looking at /etc/init.d/udev, it's probably something debian-specific,
 to be honest.

 also, something to watch out for: the /etc/init.d/udev from debian
 (0.030 this is) creates some directories and some symlinks and
 a couple of nodes (listed in /etc/udev/links.conf).

 /dev/pts and /dev/shm are both created.

 now, i don't know what happens, or what's supposed to happen, but
 i don't see a lot of restorecon action going onto those "horrible
 hack" locations.

 but hey, it seems to work.

> I'd agree that having udev directly call matchpathcon()
> and then setfscreatecon() prior to node creation would be preferable,
> but I'm not sure that it is strictly necessary - as long as the default
> creation type is suitably restrictive and nothing tries to access it
> prior to the restorecon.
 
 :)

 well, the design of udev is such that it's totally full of race
 conditions, and access between the creation and the restorecon
 is going to be the _least_ of a user's worries.

 i don't know what the default is.


 so, when that matchpathcon() and setfscreatecon() is called,
 does it:
 
 a ) guarantee that the device node "to be created" will be set with
     the correct se/linux permissions

 b ) update the selinux permissions post-creation.

 l.


--
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:[~2004-07-29 13:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-28 23:20 temporary hack to use udev in selinux Luke Kenneth Casson Leighton
2004-07-29  0:29 ` Joshua Brindle
2004-07-29  0:57   ` Luke Kenneth Casson Leighton
2004-07-29  1:35   ` Luke Kenneth Casson Leighton
2004-07-29  2:04     ` Luke Kenneth Casson Leighton
2004-07-29 12:47       ` Stephen Smalley
2004-07-29 14:20         ` Luke Kenneth Casson Leighton
2004-07-29 16:57           ` Stephen Smalley
2004-07-29 17:06             ` James Morris
2004-07-29 17:22               ` Stephen Smalley
2004-07-29 20:05                 ` Luke Kenneth Casson Leighton
2004-07-29 20:09                   ` Stephen Smalley
2004-07-31  1:43                     ` Russell Coker
2004-07-31 16:35                       ` Luke Kenneth Casson Leighton
2004-08-01 10:31                         ` Russell Coker
2004-08-01 12:03                           ` Luke Kenneth Casson Leighton
2004-08-02 13:10                             ` Stephen Smalley
2004-08-01 12:11                           ` Luke Kenneth Casson Leighton
2004-08-02 12:38                         ` Stephen Smalley
2004-08-02 12:35                       ` Stephen Smalley
2004-07-29 20:59               ` Valdis.Kletnieks
2004-07-29 22:11                 ` Luke Kenneth Casson Leighton
2004-07-29 14:22         ` Luke Kenneth Casson Leighton
2004-07-29 14:35         ` Luke Kenneth Casson Leighton
2004-07-29 17:04           ` James Morris
2004-07-29 20:56             ` Valdis.Kletnieks
2004-07-29 12:43   ` Stephen Smalley
2004-07-29 13:53     ` Luke Kenneth Casson Leighton [this message]
2004-07-29 14:25       ` Stephen Smalley
2004-07-29 12:36 ` Stephen Smalley
2004-07-29 13:57   ` Luke Kenneth Casson Leighton

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=20040729135312.GA8858@lkcl.net \
    --to=lkcl@lkcl.net \
    --cc=dwalsh@redhat.com \
    --cc=jmorris@redhat.com \
    --cc=method@gentoo.org \
    --cc=sds@epoch.ncsc.mil \
    --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.