All of lore.kernel.org
 help / color / mirror / Atom feed
* object class discovery userland
@ 2007-04-20 14:01 Christopher J. PeBenito
  2007-04-20 14:04 ` Joshua Brindle
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Christopher J. PeBenito @ 2007-04-20 14:01 UTC (permalink / raw)
  To: SELinux Mail List; +Cc: Stephen Smalley, Joshua Brindle

I have nearly completed the kernel patch for object class discovery
which creates the structure:

/selinux/class/CLASSNAME/index
/selinux/class/CLASSNAME/perms/PERMNAME

so you get the class index number from the index file, and the
permission name file gets the index number of the permission.  I started
looking at the userland side of this, and there are some relevant
functions:

security_class_t string_to_security_class(const char *name);
const char *security_class_to_string(security_class_t cls);

access_vector_t string_to_av_perm(security_class_t tclass, const char *name);
const char *security_av_perm_to_string(security_class_t tclass, access_vector_t perm);

The implementation for the first one is straightforward, just look at
the index file for the class.  The other three are a little more
problematic with the above structure since they use an index, since it
would have to search through the CLASSNAME/index files to find the right
one.

So to get the reverse lookup we could:
1. search /selinux/class/ in the userland code
2. create symlinks /selinux/class, one possible structure:

/selinux/class/1 -> security
/selinux/class/2 -> process
/selinux/class/security/perms/1 -> compute_av
/selinux/class/security/perms/2 -> compute_create

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.

4. other ideas?

-- 
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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.

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: object class discovery userland
@ 2007-04-23 16:33 Nick Nam
  0 siblings, 0 replies; 33+ messages in thread
From: Nick Nam @ 2007-04-23 16:33 UTC (permalink / raw)
  To: jbrindle, sds, cpebenito; +Cc: ewalsh, selinux



-----Original Message-----
From: Joshua Brindle
To: Stephen Smalley; Christopher J. PeBenito
CC: Eamon Walsh; SELinux Mail List
Sent: Mon Apr 23 10:43:52 2007
Subject: RE: object class discovery userland

> 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?


--
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.




--
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.

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: object class discovery userland
@ 2007-04-23 16:36 Nick Nam
  0 siblings, 0 replies; 33+ messages in thread
From: Nick Nam @ 2007-04-23 16:36 UTC (permalink / raw)
  To: jbrindle, sds, cpebenito; +Cc: ewalsh, selinux



-----Original Message-----
From: Joshua Brindle
To: Stephen Smalley; Christopher J. PeBenito
CC: Eamon Walsh; SELinux Mail List
Sent: Mon Apr 23 10:43:52 2007
Subject: RE: object class discovery userland

> 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?


--
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.




--
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.

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2007-06-01 17:18 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.