Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177596972
D8671.1794816039.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D8671.1794816039.diff
View Options
Index: sys/netpfil/pf/if_pfsync.c
===================================================================
--- sys/netpfil/pf/if_pfsync.c
+++ sys/netpfil/pf/if_pfsync.c
@@ -1509,7 +1509,7 @@
struct ip *ip;
struct pfsync_header *ph;
struct pfsync_subheader *subh;
- struct pf_state *st;
+ struct pf_state *st, *st_next;
struct pfsync_upd_req_item *ur;
int offset;
int q, count = 0;
@@ -1559,7 +1559,7 @@
offset += sizeof(*subh);
count = 0;
- TAILQ_FOREACH(st, &sc->sc_qs[q], sync_list) {
+ TAILQ_FOREACH_SAFE(st, &sc->sc_qs[q], sync_list, st_next) {
KASSERT(st->sync_state == q,
("%s: st->sync_state == q",
__func__));
@@ -1931,6 +1931,8 @@
if (sc->sc_len == PFSYNC_MINPKT)
callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif);
+ pf_ref_state(st);
+
switch (st->sync_state) {
case PFSYNC_S_INS:
/* We never got to tell the world so just forget about it. */
@@ -1950,6 +1952,9 @@
default:
panic("%s: unexpected sync state %d", __func__, st->sync_state);
}
+
+ pf_release_state(st);
+
PFSYNC_UNLOCK(sc);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 8:00 AM (4 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41767970
Default Alt Text
D8671.1794816039.diff (1 KB)
Attached To
Mode
D8671: Fix use-after-free bugs in pfsync(4)
Attached
Detach File
Event Timeline