[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5bfa5213-7d1b-684a-9e21-488fcbf14b91@redhat.com>
Date: Wed, 10 Jun 2020 13:00:35 -0700
From: Tom Rix <trix@...hat.com>
To: Stephen Smalley <stephen.smalley.work@...il.com>
Cc: Paul Moore <paul@...l-moore.com>,
Eric Paris <eparis@...isplace.org>,
Ondrej Mosnacek <omosnace@...hat.com>,
Jeffrey Vander Stoep <jeffv@...gle.com>, rgb@...hat.com,
SElinux list <selinux@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] selinux: fix double free
>> +++ b/security/selinux/ss/services.c
>> @@ -2888,8 +2888,12 @@ int security_get_bools(struct selinux_state *state,
>> if (*names) {
>> for (i = 0; i < *len; i++)
>> kfree((*names)[i]);
>> + kfree(names);
> kfree(*names)?
Yes.
> kfree(*values);
>> + *len = 0;
>> + *names = NULL;
>> + *values = NULL;
>> goto out;
>> }
> Wondering if the caller handling ought to be changed too even though
> this should avoid the problem.
>
The poisoning of the returns avoids this.
Powered by blists - more mailing lists