All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eamon Walsh <ewalsh@tycho.nsa.gov>
To: "Christopher J. PeBenito" <cpebenito@tresys.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
	Joshua Brindle <jbrindle@tresys.com>,
	SELinux Mail List <selinux@tycho.nsa.gov>
Subject: Re: object class discovery userland
Date: Wed, 23 May 2007 14:51:58 -0400	[thread overview]
Message-ID: <46548D4E.50000@tycho.nsa.gov> (raw)
In-Reply-To: <1179929852.10995.51.camel@sgc.columbia.tresys.com>

Christopher J. PeBenito wrote:
> On Mon, 2007-04-23 at 10:58 -0400, Stephen Smalley wrote:
>> On Mon, 2007-04-23 at 10:43 -0400, Joshua Brindle wrote:
>>>> From: Stephen Smalley [mailto:sds@tycho.nsa.gov] 
>>>>
>>>> On Fri, 2007-04-20 at 13:19 -0400, Christopher J. PeBenito wrote:
>>>>> On Fri, 2007-04-20 at 13:02 -0400, Eamon Walsh wrote:
>>>>>> Eamon Walsh wrote:
>>>>>>> Christopher J. PeBenito wrote:
>>>>>>>> 3. stop exporting class and perm indexes outside of the 
>>>>>>>> libraries.  Then the reverse lookup wouldn't be needed.  This 
>>>>>>>> would involve some overhauling of the libraries.
>>>>>>> I don't think this is a good idea because of the disruption it 
>>>>>>> would cause with access vector processing (as passed to 
>>>>>>> security_av_string() and avc_has_perm()).  How do you 
>>>> or together strings?
>>>>>>> Why not just cache the numbers in the library, as Karl 
>>>> suggested, 
>>>>>>> or create a parallel "class_num" or "class_index" 
>>>> directory with 
>>>>>>> numeric nodes (perhaps renaming class to class_name).
>>>>>>>
>>>>>> class_num/1/perms/1
>>>>>> class_num/1/name
>>>>> I don't feel strongly about any of my suggestions, I mainly 
>>>> wanted to 
>>>>> get the discussion going.  The inspiration for symlink idea 
>>>> was from 
>>>>> all the symlinking you see in sysfs, but the above 
>>>> structure certainly 
>>>>> is an option too.
>>>> I'd recommend caching in the library and doing the reverse 
>>>> lookup there rather than encoding it into the pseudo filesystem state.
>>> Making the library open and cache every class and permission seems
>>> undesirable. What do you have against doing it from the filesystem?
>> You don't have to cache them all - the cache can be populated lazily
>> (but I'd expect it to pull in an entire class at a time).
>>
>> I'm not keen on having redundant information in the filesystem state,
>> and I don't think these operations are on the critical path anyway for
>> performance.
> 
> One issue that we realized on this is that the cache is going to have to
> be flushed when the policy is reloaded.  For object managers that have a
> full AVC that is simple, since we can just add it to the netlink socket
> handler where it resets the AVC.
> 
> However, for simple ones such as passwd and crond which, don't need an
> AVC, there isn't a facility now.  Crond should be ok since it only
> checks process permissions, which can't change on policy reload.
> Perhaps a lighter version of the netlink support that just listens for
> policy reloads?

We could require a call to avc_init() for anyone wishing to do lookups. 
  An empty AVC shouldn't affect performance that much.

The netlink stuff is all in src/avc_internal.c.  There are two copies of 
the netlink code, one for threaded and one for unthreaded.  Maybe they 
could be refactored down to a single function used by both.


> 
> The object manager will also have to be modified to get the new class
> and perm values on a policy reload.
> 

Sigh.  Maybe we _would_ be better off hiding the numeric values from the 
caller.


-- 
Eamon Walsh <ewalsh@tycho.nsa.gov>
National Security Agency

--
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:[~2007-05-23 18:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20 14:01 object class discovery userland Christopher J. PeBenito
2007-04-20 14:04 ` Joshua Brindle
2007-04-20 14:17   ` Karl MacMillan
2007-04-20 14:23     ` Joshua Brindle
2007-04-20 14:22       ` Karl MacMillan
2007-04-20 14:27         ` Joshua Brindle
2007-04-20 14:58 ` KaiGai Kohei
2007-04-20 15:32   ` Christopher J. PeBenito
2007-04-20 16:54 ` Eamon Walsh
2007-04-20 17:02   ` Eamon Walsh
2007-04-20 17:19     ` Christopher J. PeBenito
2007-04-23 14:33       ` Stephen Smalley
2007-04-23 14:43         ` Joshua Brindle
2007-04-23 14:58           ` Stephen Smalley
2007-05-23 14:17             ` Christopher J. PeBenito
2007-05-23 18:51               ` Eamon Walsh [this message]
2007-05-24 23:46                 ` Eamon Walsh
2007-05-24 23:55                   ` Joshua Brindle
2007-05-25  0:00                   ` Joshua Brindle
2007-05-25 21:10                     ` Eamon Walsh
2007-05-25 22:36                       ` Joshua Brindle
2007-05-29 17:50                         ` Eamon Walsh
2007-05-29 18:36                           ` Stephen Smalley
2007-05-29 18:24                       ` Stephen Smalley
2007-05-29 19:17                         ` Eamon Walsh
2007-05-30  2:20                       ` KaiGai Kohei
2007-05-30 20:01                         ` Eamon Walsh
2007-05-31 13:28                           ` KaiGai Kohei
2007-06-01 17:18                             ` Eamon Walsh
2007-05-29 18:19               ` Stephen Smalley
2007-05-29 19:06                 ` Eamon Walsh
  -- strict thread matches above, loose matches on Subject: below --
2007-04-23 16:33 Nick Nam
2007-04-23 16:36 Nick Nam

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=46548D4E.50000@tycho.nsa.gov \
    --to=ewalsh@tycho.nsa.gov \
    --cc=cpebenito@tresys.com \
    --cc=jbrindle@tresys.com \
    --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.