From: Stephen Smalley <sds@tycho.nsa.gov>
To: Ondrej Oprala <ooprala@redhat.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: setfscreatecon optimizations
Date: Tue, 08 Jan 2013 09:48:14 -0500 [thread overview]
Message-ID: <50EC31AE.5040807@tycho.nsa.gov> (raw)
In-Reply-To: <50EC1D32.3090607@redhat.com>
On 01/08/2013 08:20 AM, Ondrej Oprala wrote:
> Hi, there have been some attempts on the coreutils mailing list at
> optimizing cp copying by caching the selinux security context ( please
> see: http://lists.gnu.org/archive/html/coreutils/2013-01/msg00012.html ).
> Would it be possible to perform some kind of caching inside
> setfscreatecon? For example not going through the whole process of
> setfscreatecon if the context to be set equals the current one?
I think that should be possible. The relevant code that would need to
be modified is in libselinux/src/procattr.c. You would likely want to
modify the common helper for all of the set*con functions,
setprocattrcon_raw(). A conceptually similar cache exists in
libselinux/src/setrans_client.c; note the methods used to make it
thread-safe and to ensure that it is properly freed. You would need a
separate cache for each kind of attribute that can be set, i.e. current,
exec, fscreate, keycreate, sockcreate. You could likely also cache the tid.
--
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:[~2013-01-08 14:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 13:20 setfscreatecon optimizations Ondrej Oprala
2013-01-08 14:48 ` Stephen Smalley [this message]
2013-01-09 12:03 ` Ondrej Oprala
2013-01-09 14:30 ` Eric Paris
2013-01-09 14:51 ` Eric Paris
2013-01-09 20:17 ` Ondrej Oprala
2013-01-09 21:30 ` Daniel J Walsh
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=50EC31AE.5040807@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=ooprala@redhat.com \
--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.