All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <jbrindle@tresys.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux <selinux@tycho.nsa.gov>, selinux-dev@tresys.com
Subject: Re: [Patch 1/3] Loadable policy module infrastructure
Date: Tue, 31 May 2005 15:28:33 -0400	[thread overview]
Message-ID: <1117567714.9785.76.camel@localhost> (raw)
In-Reply-To: <1117564703.28924.243.camel@moss-spartans.epoch.ncsc.mil>

On Tue, 2005-05-31 at 14:38 -0400, Stephen Smalley wrote:
> On Thu, 2005-05-26 at 13:27 -0400, Joshua Brindle wrote:
> > diff -burNd a1/libsepol/src/util.c b/libsepol/src/util.c
> > --- a1/libsepol/src/util.c	1969-12-31 19:00:00.000000000 -0500
> > +++ b/libsepol/src/util.c	2005-05-25 13:11:19.488060776 -0400
> > +int type_set_or(type_set_t *dst, type_set_t *a, type_set_t *b)
> > +{
> > +        type_set_init(dst);
> > +
> > +        if (ebitmap_or(&dst->types, &a->types, &b->types)) {
> > +                fprintf(stderr, "Memory error\n");
> > +                return -1;
> > +        }
> > +        if (ebitmap_or(&dst->negset, &a->negset, &b->negset)) {
> > +                fprintf(stderr, "Memory error\n");
> > +                return -1;
> > +        }
> > +
> > +        dst->flags |= a->flags;
> > +        dst->flags |= b->flags;
> > +
> > +        return 0;
> > +}
> 
> I don't see any users of this function or even an exported function
> prototype for it (or for a number of other functions), but am uncertain
> about its semantics if it is going to be used.  The simple or'ing of the
> negset and flags means that:
> - anything excluded from either set will be excluded from the result
> even if it was present in the other set,
> - if either set is a set complement, then the result will be the
> complement of the union.
> 
> That's quite different from an ebitmap_or() of the expanded type sets.
> 

You are right, the semantics of this are funny, this is used in the
linking code to essentially copy avrules from modules to the base. The
best thing to do is probably get rid of this or function and replace it
with a copy function so that we don't run into bugs.

Joshua


--
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:[~2005-05-31 19:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-26 17:27 [Patch 1/3] Loadable policy module infrastructure Joshua Brindle
2005-05-31 15:49 ` Stephen Smalley
2005-05-31 19:53   ` Joshua Brindle
2005-05-31 20:05     ` Stephen Smalley
2005-05-31 18:00 ` Stephen Smalley
2005-05-31 18:15   ` Joshua Brindle
2005-05-31 18:38 ` Stephen Smalley
2005-05-31 19:28   ` Joshua Brindle [this message]
2005-06-01 15:13 ` Stephen Smalley
2005-06-01 19:22   ` Joshua Brindle
2005-06-09 12:33 ` 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=1117567714.9785.76.camel@localhost \
    --to=jbrindle@tresys.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux-dev@tresys.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.