HomeFreeBSD

netmap: fix memory leak in NETMAP_REQ_PORT_INFO_GET

Description

netmap: fix memory leak in NETMAP_REQ_PORT_INFO_GET

The netmap_ioctl() function has a reference counting bug in case of
NETMAP_REQ_PORT_INFO_GET command. When hdr->nr_name[0] == '\0',
the function does not decrease the refcount of "nmd", which is
increased by netmap_mem_find(), causing a refcount leak.

Reported by: Xiyu Yang <sherllyyang00@gmail.com>
Submitted by: Carl Smith <carl.smith@alliedtelesis.co.nz>
MFC after: 3 days
PR: 254311

Details

Provenance
vmaffioneAuthored on Mar 15 2021, 5:39 PM
Parents
rGa2aac2f5e564: pkg(7): when bootstrapping first search for pkg.bsd file then pkg.txz
Branches
Unknown
Tags
Unknown