mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
pf: do not leak a source hash row lock in the netlink dump
pf_handle_get_srcnodes() returns with the lock of a source hash row
held when it cannot start the message for a source node. Unlock the
row there, as the other error exit of the loop does.
Reviewed by: kp
Approved by: kp (mentor)
Fixes: 9c12533672 ("pf: convert DIOCGETSRCNODES to netlink")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60251
This commit is contained in:
1 file changed
+1
@@ -1824,6 +1824,7 @@ pf_handle_get_srcnodes(struct nlmsghdr *hdr, struct nl_pstate *npt)
|
||||
|
||||
LIST_FOREACH(n, &sh->nodes, entry) {
|
||||
if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) {
|
||||
PF_HASHROW_UNLOCK(sh);
|
||||
nlmsg_abort(nw);
|
||||
return (ENOMEM);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user