From: "Christopher J. PeBenito" <cpebenito@tresys.com>
To: James Morris <jmorris@namei.org>
Cc: sds@tycho.nsa.gov, jmorris@redhat.com, eparis@redhat.com,
selinux@tycho.nsa.gov
Subject: Re: [PATCH 4/4] selinux: add selinuxfs structure for object class discovery
Date: Mon, 21 May 2007 18:41:43 +0000 [thread overview]
Message-ID: <1179772903.10995.13.camel@sgc> (raw)
In-Reply-To: <Line.LNX.4.64.0705211306480.17008@d.namei>
On Mon, 2007-05-21 at 13:18 -0400, James Morris wrote:
> On Mon, 21 May 2007, Christopher J. PeBenito wrote:
>
> > From: Christopher J. PeBenito <cpebenito@tresys.com>
> >
> > The structure is as follows (relative to selinuxfs root):
> >
> > /class/file/index
> > /class/file/perms/read
> > /class/file/perms/write
> > ...
> >
> > Each class is allocated 33 inodes, 1 for the class index and 32 for
> > permissions. Relative to SEL_CLASS_INO_OFFSET, the inode of the index file
> > DIV 33 is the class number. The inode of the permission file % 33 is the
> > index of the permission for that class.
>
> Keep in mind that any of these may need to be 64-bit at some point, so be
> careful about hard-coding any 32-bit assumptions into the kernel/user API.
Well its 32 because the access vector is a u32, so an object class can
only have 32 perms max, which is why I had the following macro. Perhaps
the macro should be moved to security.h, next to the struct av_decision
definition?
> > +#define NVECTORS 32
>
> Macro name is too generic.
Maybe something like SEL_AV_MAX or SEL_PERM_MAX?
> > +#define DIV(a, b) ((a) / (b) - ((a) % (b) < 0))
>
> Also too generic, and should be a static inline.
Ok. I noticed it other places in the kernel, which is why I used it.
What should it be called? sel_div()?
--
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.
next prev parent reply other threads:[~2007-05-21 18:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-21 15:38 [PATCH 0/4] selinux: add object class discovery Christopher J. PeBenito
2007-05-21 15:38 ` [PATCH 1/4] selinux: add support for querying object classes and permissions from the running policy Christopher J. PeBenito
2007-05-21 15:38 ` [PATCH 2/4] selinux: rename sel_remove_bools() for more general usage Christopher J. PeBenito
2007-05-21 15:38 ` [PATCH 3/4] selinux: change sel_make_dir() to specify inode counter Christopher J. PeBenito
2007-05-21 15:38 ` [PATCH 4/4] selinux: add selinuxfs structure for object class discovery Christopher J. PeBenito
2007-05-21 17:18 ` James Morris
2007-05-21 18:41 ` Christopher J. PeBenito [this message]
2007-05-21 18:58 ` James Morris
2007-05-21 17:02 ` [PATCH 1/4] selinux: add support for querying object classes and permissions from the running policy James Morris
2007-05-21 18:44 ` Christopher J. PeBenito
-- strict thread matches above, loose matches on Subject: below --
2007-05-23 13:12 selinux: add object class discovery v2 Christopher J. PeBenito
2007-05-23 13:12 ` [PATCH 1/4] selinux: add support for querying object classes and permissions from the running policy Christopher J. PeBenito
2007-05-23 13:12 ` [PATCH 2/4] selinux: rename sel_remove_bools() for more general usage Christopher J. PeBenito
2007-05-23 13:12 ` [PATCH 3/4] selinux: change sel_make_dir() to specify inode counter Christopher J. PeBenito
2007-05-23 13:12 ` [PATCH 4/4] selinux: add selinuxfs structure for object class discovery Christopher J. PeBenito
2007-05-30 15:06 ` Stephen Smalley
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=1179772903.10995.13.camel@sgc \
--to=cpebenito@tresys.com \
--cc=eparis@redhat.com \
--cc=jmorris@namei.org \
--cc=jmorris@redhat.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.