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

(cherry picked from commit 0ab5902e8ad93d0a9341dcce386b6c571ee02173)

Details

Provenance
vmaffioneAuthored on Mar 15 2021, 5:39 PM
Parents
rG4f2e8545f7fd: vfs: fix vnlru marker handling for filtered/unfiltered cases
Branches
Unknown
Tags
Unknown