From: James Carter <jwcart2@gmail.com>
To: "Christian Göttsche" <cgzones@googlemail.com>
Cc: selinux@vger.kernel.org
Subject: Re: [PATCH] checkpolicy/fuzz: Update check_level() to use notdefined field
Date: Thu, 7 Mar 2024 09:15:18 -0500 [thread overview]
Message-ID: <CAP+JOzSU+10+HnFT94-otNkp4Zr474nbnFWDv_XLsKZGk53fYw@mail.gmail.com> (raw)
In-Reply-To: <CAJ2a_De2X6Ux5et0kEu7fmfgwZeYtq_OLVNXbX6M4tsbucqvew@mail.gmail.com>
On Wed, Mar 6, 2024 at 2:22 PM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> On Wed, 6 Mar 2024 at 15:34, James Carter <jwcart2@gmail.com> wrote:
> >
> > Commit e16f586 (Fix potential double free of mls_level_t) renamed
> > the "defined" field to "notdefined", but did not update this use of
> > it.
> >
> > Use the new field "notdefined" for the check.
>
> Since the renamed member "notdefined" is checked during validation and
> the fuzzer calls policydb_valudate() I think the whole callback can be
> removed.
>
I left it in for now because checkpolicy does a similar check and I
wanted to get this merged as soon as possible since it was breaking
the fuzzer.
> > Signed-off-by: James Carter <jwcart2@gmail.com>
This patch has been merged.
Thanks,
Jim
> > ---
> > checkpolicy/fuzz/checkpolicy-fuzzer.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/checkpolicy/fuzz/checkpolicy-fuzzer.c b/checkpolicy/fuzz/checkpolicy-fuzzer.c
> > index 0d749a02..a3da0b57 100644
> > --- a/checkpolicy/fuzz/checkpolicy-fuzzer.c
> > +++ b/checkpolicy/fuzz/checkpolicy-fuzzer.c
> > @@ -135,7 +135,7 @@ static int check_level(hashtab_key_t key, hashtab_datum_t datum, void *arg __att
> > const level_datum_t *levdatum = (level_datum_t *) datum;
> >
> > // TODO: drop member defined if proven to be always set
> > - if (!levdatum->isalias && !levdatum->defined) {
> > + if (!levdatum->isalias && levdatum->notdefined) {
> > fprintf(stderr,
> > "Error: sensitivity %s was not used in a level definition!\n",
> > key);
> > --
> > 2.44.0
> >
prev parent reply other threads:[~2024-03-07 14:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 14:34 [PATCH] checkpolicy/fuzz: Update check_level() to use notdefined field James Carter
2024-03-06 19:22 ` Christian Göttsche
2024-03-07 14:15 ` James Carter [this message]
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=CAP+JOzSU+10+HnFT94-otNkp4Zr474nbnFWDv_XLsKZGk53fYw@mail.gmail.com \
--to=jwcart2@gmail.com \
--cc=cgzones@googlemail.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).