git: 838edd2c9dc6 - stable/12 - pf: make sure the dtrace probe has safe access to state

Mateusz Guzik mjg at FreeBSD.org
Mon Jul 5 12:02:04 UTC 2021


The branch stable/12 has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=838edd2c9dc6e7920c8fd9629d3ee6111c1db189

commit 838edd2c9dc6e7920c8fd9629d3ee6111c1db189
Author:     Mateusz Guzik <mjg at FreeBSD.org>
AuthorDate: 2021-06-28 19:32:20 +0000
Commit:     Mateusz Guzik <mjg at FreeBSD.org>
CommitDate: 2021-07-05 11:38:05 +0000

    pf: make sure the dtrace probe has safe access to state
    
    Reviewed by:    kp
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    
    (cherry picked from commit d26ef5c7ac830812f07a02787f25fed5d6f8609e)
---
 sys/netpfil/pf/pf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 4f45f5b8ea96..c76207d1e7f1 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -6405,11 +6405,12 @@ done:
 		}
 		break;
 	}
-	if (s)
-		PF_STATE_UNLOCK(s);
 
 	SDT_PROBE4(pf, ip, test, done, action, reason, r, s);
 
+	if (s)
+		PF_STATE_UNLOCK(s);
+
 	return (action);
 }
 #endif /* INET */


More information about the dev-commits-src-all mailing list