From: Dominick Grift <dominick.grift@defensec.nl>
To: James Carter <jwcart2@gmail.com>
Cc: selinux@vger.kernel.org
Subject: Re: [PATCH] libsepol/cil: Allow dotted names in aliasactual rules
Date: Mon, 12 Aug 2024 19:01:10 +0200 [thread overview]
Message-ID: <87wmklzne1.fsf@defensec.nl> (raw)
In-Reply-To: <20240812165633.49121-1-jwcart2@gmail.com> (James Carter's message of "Mon, 12 Aug 2024 12:56:33 -0400")
James Carter <jwcart2@gmail.com> writes:
> The function cil_gen_alias() is used to declare type, sensitivity,
> and category aliases and the function cil_gen_aliasactual() is used
> to assign an alias to the actual declared name.
>
> Commit e55621c03 ("libsepol/cil: Add notself and other support to CIL")
> added "notself" and "other" as reserved words. Previously, a check
> was made in cil_gen_aliasactual() to ensure that the "self" reserved
> word was not used. With the notself patch this function was upgraded
> to call cil_verify_name() to verify that the other reserved words
> were not used as well. This change prevents the use of dotted names
> to refer to alias or actual names that are declared in blocks.
>
> The check for a reserved word being used is not needed because that
> check will be done for both the alias and the actual name when they
> are declared.
>
> Remove the call to cil_verify_name() and allow dotted names in
> aliasactual rules.
>
> Reported-by: Dominick Grift <dominick.grift@defensec.nl>
> Signed-off-by: James Carter <jwcart2@gmail.com>
Thank you.
> ---
> libsepol/cil/src/cil_build_ast.c | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
> index 56dac891..6884f12c 100644
> --- a/libsepol/cil/src/cil_build_ast.c
> +++ b/libsepol/cil/src/cil_build_ast.c
> @@ -3174,16 +3174,6 @@ int cil_gen_aliasactual(struct cil_db *db, struct cil_tree_node *parse_current,
> goto exit;
> }
>
> - rc = cil_verify_name(db, parse_current->next->data, flavor);
> - if (rc != SEPOL_OK) {
> - goto exit;
> - }
> -
> - rc = cil_verify_name(db, parse_current->next->next->data, flavor);
> - if (rc != SEPOL_OK) {
> - goto exit;
> - }
> -
> cil_aliasactual_init(&aliasactual);
>
> aliasactual->alias_str = parse_current->next->data;
--
gpg --locate-keys dominick.grift@defensec.nl (wkd)
Key fingerprint = FCD2 3660 5D6B 9D27 7FC6 E0FF DA7E 521F 10F6 4098
Dominick Grift
Mastodon: @kcinimod@defensec.nl
next prev parent reply other threads:[~2024-08-12 17:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 16:56 [PATCH] libsepol/cil: Allow dotted names in aliasactual rules James Carter
2024-08-12 17:01 ` Dominick Grift [this message]
2024-09-04 19:37 ` James Carter
2024-09-05 19:05 ` James Carter
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=87wmklzne1.fsf@defensec.nl \
--to=dominick.grift@defensec.nl \
--cc=jwcart2@gmail.com \
--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 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.