diff options
author | Alexandr Nedvedicky <sashan@cvs.openbsd.org> | 2023-02-15 18:11:48 +0000 |
---|---|---|
committer | Alexandr Nedvedicky <sashan@cvs.openbsd.org> | 2023-02-15 18:11:48 +0000 |
commit | bf29ce86459b6b1c3fbf9b048eebcb7bea4207dc (patch) | |
tree | b26d03655b15639183658cf9deb39af82e768192 /sys | |
parent | c83c6c066c8f362ee3bf280f59d8ad451034aaa0 (diff) |
pfsync(4) panics on NULL pointer dereference if there
are no data ready for bulk transfer. reported and fix
kindly tested by hrvoje@
OK bluhm@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_pfsync.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index e2c86971336..600d474ae3b 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.312 2023/01/04 10:31:55 dlg Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.313 2023/02/15 18:11:47 sashan Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -2464,6 +2464,11 @@ pfsync_bulk_update(void *arg) st = sc->sc_bulk_next; sc->sc_bulk_next = NULL; + if (st == NULL) { + rw_exit_read(&pf_state_list.pfs_rwl); + goto out; + } + for (;;) { if (st->sync_state == PFSYNC_S_NONE && st->timeout < PFTM_MAX && |