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.

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

(cherry picked from commit 0ab5902e8ad93d0a9341dcce386b6c571ee02173)
(cherry picked from commit 120a4bd4e9d05147a9774a2ca4b4eff48e062442)

Details

Provenance
vmaffioneAuthored on Mar 15 2021, 5:39 PM
Parents
rGa9c7d90862ef: [PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask().
Branches
Unknown
Tags
Unknown