From: Stephen Smalley <sds@tycho.nsa.gov>
To: Thomas Hurd <thurd@tresys.com>, selinux@tycho.nsa.gov
Subject: Re: [PATCH] libsepol: bool_copy_callback set state on creation
Date: Thu, 19 Mar 2015 14:44:58 -0400 [thread overview]
Message-ID: <550B192A.7030008@tycho.nsa.gov> (raw)
In-Reply-To: <1426784629-24048-1-git-send-email-thurd@tresys.com>
On 03/19/2015 01:03 PM, Thomas Hurd wrote:
> Boolean states are only written on a declaration.
> If a module is turned off which includes a tunable declaration that
> is required in another module, the state is never set. This patch
> sets the state when the booldatum is created so that an uninitialized
> memory read does not occur in cond_write_bool and write garbage to
> the link binary. This can cause a failure in cond_read_bool when
> running semodule_expand.
>
> Signed-off-by: Thomas Hurd <thurd@tresys.com>
> ---
> libsepol/src/link.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/libsepol/src/link.c b/libsepol/src/link.c
> index f98a8d2..f211164 100644
> --- a/libsepol/src/link.c
> +++ b/libsepol/src/link.c
> @@ -630,6 +630,7 @@ static int bool_copy_callback(hashtab_key_t key, hashtab_datum_t datum,
> state->base->p_bools.nprim++;
> base_bool = new_bool;
> base_bool->flags = booldatum->flags;
> + base_bool->state = booldatum->state;
> } else if ((booldatum->flags & COND_BOOL_FLAGS_TUNABLE) !=
> (base_bool->flags & COND_BOOL_FLAGS_TUNABLE)) {
> /* A mismatch between boolean/tunable declaration
>
Hmm...commit 3df79fc5ebf08a35aaa095b2ee3fd24b3ece6ae5 (libsepol: fix
boolean state smashing) removed the setting of the state here, replacing
it with conditional setting iff it is a decl further down.
next prev parent reply other threads:[~2015-03-19 18:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 17:03 [PATCH] libsepol: bool_copy_callback set state on creation Thomas Hurd
2015-03-19 18:44 ` Stephen Smalley [this message]
2015-03-19 19:29 ` Thomas Hurd
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=550B192A.7030008@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=thurd@tresys.com \
/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.