Commit cb130596 authored by Kristof Provost's avatar Kristof Provost
Browse files

pf: fix pagefault in pf_getstatus()

We can't copyout() while holding a lock, in case it triggers a page
fault.
Release the lock before copyout, which is safe because we've already
copied all the data into the nvlist.

PR:		258601
Reviewed by:	mjg
MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D32076
parent d5ad2f2a
......@@ -5006,11 +5006,14 @@ pf_getstatus(struct pfioc_nv *nv)
else if (nv->size < nv->len)
ERROUT(ENOSPC);
PF_RULES_RUNLOCK();
error = copyout(nvlpacked, nv->data, nv->len);
goto done;
#undef ERROUT
errout:
PF_RULES_RUNLOCK();
done:
free(nvlpacked, M_NVLIST);
nvlist_destroy(nvc);
nvlist_destroy(nvl);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment