diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2024-11-20 10:45:39 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2024-11-20 12:35:53 +0000 |
| commit | 81f7ad324dd0cc4f2c090c1504230f4e2d58fb54 (patch) | |
| tree | b1e32e6d0d1de8face93bca256f7078c9b97829f | |
| parent | 3e2a7a2cbeb272b891c6931f2ae54ee6e5ec2c7d (diff) | |
pf: add missing unlock
If we fail to unshare the mbuf we forgot to unlock the rules.
Sponsored by: Rubicon Communications, LLC ("Netgate")
| -rw-r--r-- | sys/netpfil/pf/pf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index daf3fcf567ad..39913014334d 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9043,8 +9043,10 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 if (__predict_false(! M_WRITABLE(*m0))) { *m0 = m_unshare(*m0, M_NOWAIT); - if (*m0 == NULL) + if (*m0 == NULL) { + PF_RULES_RUNLOCK(); return (PF_DROP); + } } pf_init_pdesc(&pd, *m0); |
