All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karl MacMillan <kmacmillan@mentalrootkit.com>
To: Joshua Brindle <jbrindle@tresys.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>, selinux@tycho.nsa.gov
Subject: Re: [PATCH RETRY 2/3] Optionally expand neverallows
Date: Thu, 27 Jul 2006 15:37:25 -0400	[thread overview]
Message-ID: <44C915F5.8010502@mentalrootkit.com> (raw)
In-Reply-To: <44C908FD.3090208@tresys.com>

Joshua Brindle wrote:
> Stephen Smalley wrote:
>>
>>
>> Also, suppose hypothetically that one of these policydbs with expanded
>> neverallow rules is passed along to one of the other libsepol functions.
>> What behavior do you want?  Seems like avtab_write_item() would happily
>> write it out, but avtab_read_item() would choke on it (no match in
>> spec_order, so set == 0).  Do you want to be able to save these as
>> binary policy images and use them later for analysis?
>>
> Right, there is no intention to store out these policydbs. This patch 
> is similar to one I already added for access control hooks in 
> libsepol. It marks policies as invalid when you do unsupported things 
> to them, and also skips assertion and hierarchy checking.

Did you mean to include the rename for expand_avrule_decls?
>
> Index: trunk/libsepol/include/sepol/policydb/policydb.h
> ===================================================================
> --- trunk/libsepol/include/sepol/policydb/policydb.h    (revision 951)
> +++ trunk/libsepol/include/sepol/policydb/policydb.h    (working copy)
> @@ -366,6 +366,7 @@
>     uint32_t policy_type;
>     char *name;
>     char *version;
> +    int invalid;
>

Expanding the avrules doesn't really make the policydb invalid, right? 
It just makes it non-standard (tainted :) )

>
>     }
> @@ -2156,7 +2159,7 @@
>         goto cleanup;
>     hashtab_map_remove_on_error(state.out->p_types.table,
>                     type_attr_remove, type_destroy, state.out);
> -    if (check) {
> +    if (check && !(out->invalid)) {
>         if (hierarchy_check_constraints(handle, state.out))
>             goto cleanup;
>

Why disallow hierarchy checking?

> Index: trunk/libsepol/src/write.c
> ===================================================================
> --- trunk/libsepol/src/write.c    (revision 951)
> +++ trunk/libsepol/src/write.c    (working copy)
> @@ -1411,6 +1411,9 @@
>     struct policy_data pd;
>     char *policydb_str;
>
> +    if (p->invalid)
> +        return -1;
> +

A separate return code is needed so that the caller can distinguish 
between general, likely fatal errors and a policydb that can't be 
written because the format doesn't support it.

Karl




--
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:[~2006-07-27 19:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-26 18:11 [PATCH RETRY 2/3] Optionally expand neverallows Joshua Brindle
2006-07-26 20:15 ` Stephen Smalley
2006-07-27 13:09   ` Stephen Smalley
2006-07-27 18:42     ` Joshua Brindle
2006-07-27 19:37       ` Karl MacMillan [this message]
2006-07-27 19:43         ` Joshua Brindle
2006-07-27 20:16           ` Karl MacMillan
2006-07-29 15:20             ` Joshua Brindle
2006-07-27 18:34   ` Joshua Brindle
2006-07-28 12:16     ` Stephen Smalley
2006-07-28 13:33       ` 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=44C915F5.8010502@mentalrootkit.com \
    --to=kmacmillan@mentalrootkit.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.