selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jwcart2 <jwcart2@tycho.nsa.gov>
To: Richard Haines <richard_c_haines@btinternet.com>,
	selinux@vger.kernel.org
Cc: sds@tycho.nsa.gov
Subject: Re: [Non-DoD Source] [PATCH] libsepol/cil: Allow validatetrans rules to be resolved
Date: Tue, 21 May 2019 13:59:51 -0400	[thread overview]
Message-ID: <82e7d8a1-d962-2a0b-fbdc-07143a8061c3@tycho.nsa.gov> (raw)
In-Reply-To: <20190521112206.5403-1-richard_c_haines@btinternet.com>

On 5/21/19 7:22 AM, Richard Haines wrote:
> When validatetrans rule is in CIL policy it errors with:
> u3, r3, and t3 can only be used with mlsvalidatetrans rules
> 
> Will now resolve these examples:
> (validatetrans binder (and (and (eq t1 t1_t) (eq t2 t2_t)) (eq t3 t3_t)))
> (mlsvalidatetrans file (and (and (eq t1 t1_t) (eq t2 t2_t))
>      (and (eq t3 t3_t) (domby h1 h2))))
> 
> Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>

Acked-by: James Carter <jwcart2@tycho.nsa.gov>

> ---
>   libsepol/cil/src/cil_verify.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libsepol/cil/src/cil_verify.c b/libsepol/cil/src/cil_verify.c
> index 1036d73..1a21cf4 100644
> --- a/libsepol/cil/src/cil_verify.c
> +++ b/libsepol/cil/src/cil_verify.c
> @@ -221,8 +221,8 @@ int cil_verify_constraint_leaf_expr_syntax(enum cil_flavor l_flavor, enum cil_fl
>   			cil_log(CIL_ERR, "l1, l2, h1, and h2 cannot be used on the left side with a string or list on the right side\n");
>   			goto exit;
>   		} else if (l_flavor == CIL_CONS_U3 || l_flavor == CIL_CONS_R3 || l_flavor == CIL_CONS_T3) {
> -			if (expr_flavor != CIL_MLSVALIDATETRANS) {
> -				cil_log(CIL_ERR, "u3, r3, and t3 can only be used with mlsvalidatetrans rules\n");
> +			if (expr_flavor != CIL_VALIDATETRANS && expr_flavor != CIL_MLSVALIDATETRANS) {
> +				cil_log(CIL_ERR, "u3, r3, and t3 can only be used with (mls)validatetrans rules\n");
>   				goto exit;
>   			}
>   		}
> 


-- 
James Carter <jwcart2@tycho.nsa.gov>
National Security Agency

  reply	other threads:[~2019-05-21 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21 11:22 [PATCH] libsepol/cil: Allow validatetrans rules to be resolved Richard Haines
2019-05-21 17:59 ` jwcart2 [this message]
2019-05-23 14:05   ` [Non-DoD Source] " jwcart2

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=82e7d8a1-d962-2a0b-fbdc-07143a8061c3@tycho.nsa.gov \
    --to=jwcart2@tycho.nsa.gov \
    --cc=richard_c_haines@btinternet.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).