lkml.org 
[lkml]   [2020]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] selinux: fix double free
From
Date


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


\
 
 \ /
  Last update: 2020-06-10 22:00    [W:0.051 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site