Re: [PATCH] checkpolicy/fuzz: Update check_level() to use notdefined field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 6, 2024 at 2:22 PM Christian Göttsche
<cgzones@xxxxxxxxxxxxxx> wrote:
>
> On Wed, 6 Mar 2024 at 15:34, James Carter <jwcart2@xxxxxxxxx> 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@xxxxxxxxx>

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
> >





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux