All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@manicmethod.com>
To: Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
Cc: selinux@tycho.nsa.gov, Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [PATCH 1/3] libsepol: Add support for multiple target OSes
Date: Tue, 13 Oct 2009 15:56:39 -0400	[thread overview]
Message-ID: <4AD4DB77.9070904@manicmethod.com> (raw)
In-Reply-To: <1254233003.2466.59.camel@moss-stripedbass.epoch.ncsc.mil>

Paul Nuzzi wrote:
> On Wed, 2009-09-16 at 09:58 -0400, Joshua Brindle wrote:
>> I'd rather have separate ocontext structs for each system. That way it
>> is very easy to understand which ones apply to which system and you
>> don't get a crazy out of context ocontext struct.
>>
>
> I looked into having separate ocontext structs but that would involve
> changing a lot of files making the patch much larger and more intrusive.
>
>>>    	} u;
>>>    	union {
>>>    		uint32_t sclass;	/* security class for genfs */
>>> @@ -313,6 +323,17 @@ typedef struct genfs {
>>>    #define OCON_NODE6 6		/* IPv6 nodes */
>>>    #define OCON_NUM   7
>>>
>>> +/* object context array indices for Xen */
>>> +#define OCON_ISID    0    /* initial SIDs */
>>> +#define OCON_PIRQ    1    /* physical irqs */
>>> +#define OCON_IOPORT  2    /* io ports */
>>> +#define OCON_IOMEM   3    /* io memory */
>>> +#define OCON_DEVICE  4    /* pci devices */
>>> +#define OCON_DUMMY1  5    /* reserved */
>>> +#define OCON_DUMMY2  6    /* reserved */
>>> +#define OCON_NUM     7
>>> +
>>> +
>>>
>> Should these be namespaced? What if<random other system>  has io port
>> objects? You'd have to align them with each other and you have a mess of
>> keeping the numbers the same (you already do this with OCON_ISID)
>
> Variables have been namespaced and there is no more overlap with
> OCON_ISID.
>
>> Also we are relying on having the same number of OCON's which isn't good
>> I don't think. As much as I hate the policydb_compat_info (read: alot)
>> why aren't we using that to say how many ocons a xen policy really has?
>
> OCON_NUM is now dynamically read through policydb_compat_info.
>
>
>> This is messy, why not an ocontext_selinux_free() and
>> ocontext_xen_free() (note: I realize the xen_free() one won't do
>> anything except freep the ocontext_t)
>>
>
> done.
>
>>>    	len = buf[1];
>>> -	if (len != strlen(target_str)&&
>>> -	    (!alt_target_str || len != strlen(alt_target_str))) {
>>> -		ERR(fp->handle, "policydb string length %zu does not match "
>>> -		    "expected length %zu", len, strlen(target_str));
>>> +	if (len>   32) {
>>>
>> magic number 32?
>
> #defined.
>
> Thanks for your input.  Below is the updated patch for libsepol.
>

Acked-by: Joshua Brindle <method@manicmethod.com>

for the entire patchset with the following diff on top:

diff --git a/checkpolicy/checkpolicy.c b/checkpolicy/checkpolicy.c
index 76d8ed3..c5fdf19 100644
--- a/checkpolicy/checkpolicy.c
+++ b/checkpolicy/checkpolicy.c
@@ -100,8 +100,8 @@ unsigned int policyvers = POLICYDB_VERSION_MAX;
  void usage(char *progname)
  {
         printf
-           ("usage:  %s [-b] [-d] [-U handle_unknown 
(allow,deny,reject) [-M]"
-            "[-c policyvers (%d-%d)] [-o output_file] [-t platform]"
+           ("usage:  %s [-b] [-d] [-U handle_unknown 
(allow,deny,reject)] [-M]"
+            "[-c policyvers (%d-%d)] [-o output_file] [-t (selinux,xen)]"
              "[input_file]\n",
              progname, POLICYDB_VERSION_MIN, POLICYDB_VERSION_MAX);
         exit(1);


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

  parent reply	other threads:[~2009-10-13 19:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15 16:15 [PATCH 1/3] libsepol: Add support for multiple target OSes pjnuzzi
2009-09-15 16:37 ` [PATCH 2/3] checkpolicy: " pjnuzzi
2009-09-15 16:40   ` [PATCH 3/3] sepolgen: " pjnuzzi
2009-09-29 14:06   ` [PATCH 2/3] checkpolicy: " Paul Nuzzi
2009-09-16 13:58 ` [PATCH 1/3] libsepol: " Joshua Brindle
2009-09-16 17:44   ` Paul Nuzzi
2009-09-16 19:01     ` Stephen Smalley
2009-09-29 14:03   ` Paul Nuzzi
2009-10-06 14:20     ` Joshua Brindle
2009-10-07 17:37       ` Stephen Smalley
2009-10-07 18:48         ` Joshua Brindle
2009-10-13 19:56     ` Joshua Brindle [this message]
2009-10-14 19:38       ` Joshua Brindle

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=4AD4DB77.9070904@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=pjnuzzi@tycho.ncsc.mil \
    --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.