mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-25 10:01:02 +01:00
pf: fix state locking issue when dumping by id
We forgot to unlock the state after dumping it. Do so now. Sponsored by: Orange Business Services
This commit is contained in:
parent
a9639adaed
commit
b1e0f0ff9d
@ -148,6 +148,8 @@ dump_state(struct nlpcb *nlp, const struct nlmsghdr *hdr, struct pf_kstate *s,
|
|||||||
int af;
|
int af;
|
||||||
struct pf_state_key *key;
|
struct pf_state_key *key;
|
||||||
|
|
||||||
|
PF_STATE_LOCK_ASSERT(s);
|
||||||
|
|
||||||
if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr)))
|
if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr)))
|
||||||
goto enomem;
|
goto enomem;
|
||||||
|
|
||||||
@ -282,10 +284,16 @@ static int
|
|||||||
handle_getstate(struct nlpcb *nlp, struct nl_parsed_state *attrs,
|
handle_getstate(struct nlpcb *nlp, struct nl_parsed_state *attrs,
|
||||||
struct nlmsghdr *hdr, struct nl_pstate *npt)
|
struct nlmsghdr *hdr, struct nl_pstate *npt)
|
||||||
{
|
{
|
||||||
struct pf_kstate *s = pf_find_state_byid(attrs->id, attrs->creatorid);
|
struct pf_kstate *s;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
s = pf_find_state_byid(attrs->id, attrs->creatorid);
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return (ENOENT);
|
return (ENOENT);
|
||||||
return (dump_state(nlp, hdr, s, npt));
|
ret = dump_state(nlp, hdr, s, npt);
|
||||||
|
PF_STATE_UNLOCK(s);
|
||||||
|
|
||||||
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user