Re: potential memory leak in netlbl_mgmt_add_common

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

 



On Tue, Aug 18, 2020 at 9:06 AM Stephen Smalley
<stephen.smalley.work@xxxxxxxxx> wrote:
> Also, there appear to be other leaks of memory allocated near
> net/netlabel/netlabel_mgmt.c:88
> net/netlabel/netlabel_mgmt.c:201:
>      86         struct netlbl_dom_map *entry = kzalloc(sizeof(*entry),
> GFP_KERNEL);
>      87
>      88         if (!entry)
>      89                 return -ENOMEM;
> ...
>     195         } else if (info->attrs[NLBL_MGMT_A_IPV6ADDR]) {
>     196                 struct in6_addr *addr;
>     197                 struct in6_addr *mask;
>     198                 struct netlbl_domaddr6_map *map;
>     199
>     200                 addrmap = kzalloc(sizeof(*addrmap), GFP_KERNEL);
>     201                 if (addrmap == NULL) {
>     202                         ret_val = -ENOMEM;
>     203                         goto add_doi_put_def;
>     204                 }
>
> Probably the same cause for all of them.

I've had a number of interruptions this week on a variety of fronts so
I've been late in looking in on this further, but at the very least it
looks like netlbl_domhsh_free_entry() needs to free
netlbl_dom_map->netlbl_dommap_def->addrsel in the
NETLBL_NLTYPE_ADDRSELECT case.  I'll plug this hole and check the
rest.

-- 
paul moore
www.paul-moore.com



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

  Powered by Linux