From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: Stephen Smalley <sds@epoch.ncsc.mil>
Cc: SE-Linux <selinux@tycho.nsa.gov>, Daniel J Walsh <dwalsh@redhat.com>
Subject: Re: matchfilecon (the program) vs matchfilecon (the libselinux1 fn)
Date: Mon, 2 Aug 2004 21:00:52 +0100 [thread overview]
Message-ID: <20040802200052.GN4194@lkcl.net> (raw)
In-Reply-To: <1091474356.23449.272.camel@moss-spartans.epoch.ncsc.mil>
On Mon, Aug 02, 2004 at 03:19:16PM -0400, Stephen Smalley wrote:
> On Mon, 2004-08-02 at 15:12, Luke Kenneth Casson Leighton wrote:
> > On Mon, Aug 02, 2004 at 10:52:05AM -0400, Stephen Smalley wrote:
> > > What's the objection to patching udev to directly invoke matchpathcon(3)
> > > and setfscreatecon(3) prior to creating each device node?
> >
> > time! how long do those function calls take?
> >
> > using /sbin/restorecon, which is the present hack, each device node
> > creation takes around a quarter of a second (!!)
>
> Directly invoking the library functions has to be faster than exec'ing a
> separate helper program (restorecon) that then invokes the library
> functions. Further, restorecon has to re-lookup the device node in the
> filesystem, whereas udev can set up its context upon initial creation.
> Further, matchpathcon() caches the file context specification upon the
> first call, so if the udev process stays around for multiple device
> creations, then subsequent matchpathcon() calls will be a bit faster
> (although pathname regex matching is still going to take time).
great.
> In any event, the patch to udev would naturally be #ifdef'd
> WITH_SELINUX, so no effect on non-SELinux users.
and is_selinux_enabled() even :)
> Dan had a patch at one
> time, although I'm not sure that it used setfscreatecon(); it may have
> done a setfilecon() after creation. Preferable to use setfscreatecon()
> prior to creation, but either way is ok as long as you guarantee that no
> access is possible prior to labeling.
if it was the one that was in udev-0.024, it was setfilecon.
it was taken out, along with the dbus patch, due to the amount of time
that (both these patches) were perceived as hitting the system with.
i mean, dbus was causing a ONE SECOND delay per device node.
from what i can gather, i believe the selinux patch got
painted with the same tar brush.
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.
next prev parent reply other threads:[~2004-08-02 19:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-01 17:27 matchfilecon (the program) vs matchfilecon (the libselinux1 fn) Luke Kenneth Casson Leighton
2004-08-02 14:00 ` Stephen Smalley
2004-08-02 14:57 ` Luke Kenneth Casson Leighton
2004-08-02 14:52 ` Stephen Smalley
2004-08-02 15:00 ` Stephen Smalley
2004-08-02 19:12 ` Luke Kenneth Casson Leighton
2004-08-02 19:19 ` Stephen Smalley
2004-08-02 20:00 ` Luke Kenneth Casson Leighton [this message]
2004-08-02 20:10 ` Luke Kenneth Casson Leighton
2004-08-02 21:12 ` Luke Kenneth Casson Leighton
2004-08-02 21:12 ` Luke Kenneth Casson Leighton
2004-08-03 11:11 ` Stephen Smalley
2004-08-03 11:11 ` Stephen Smalley
2004-08-03 13:37 ` Luke Kenneth Casson Leighton
2004-08-03 13:37 ` Luke Kenneth Casson Leighton
2004-08-06 12:05 ` Russell Coker
2004-08-06 12:05 ` Russell Coker
2004-08-07 12:23 ` Luke Kenneth Casson Leighton
2004-08-07 12:23 ` Luke Kenneth Casson Leighton
2004-08-02 21:25 ` Luke Kenneth Casson Leighton
2004-08-02 21:25 ` 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=20040802200052.GN4194@lkcl.net \
--to=lkcl@lkcl.net \
--cc=dwalsh@redhat.com \
--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.