Page MenuHomeFreeBSD

pf: ensure states passed to pf_free_state() are always unlinked
ClosedPublic

Authored by kp on Aug 31 2021, 3:04 PM.
Tags
None
Referenced Files
F108429503: D31752.id.diff
Fri, Jan 24, 5:18 PM
Unknown Object (File)
Fri, Jan 17, 3:37 PM
Unknown Object (File)
Dec 25 2024, 11:09 PM
Unknown Object (File)
Dec 9 2024, 4:01 PM
Unknown Object (File)
Nov 25 2024, 12:23 AM
Unknown Object (File)
Nov 16 2024, 10:56 PM
Unknown Object (File)
Nov 14 2024, 1:46 AM
Unknown Object (File)
Oct 12 2024, 8:41 PM

Details

Summary

In pf_create_state() we can end up deleting the state immediately. This
can happen if we fail to map the relevant addresses or fail
normalization or fail to insert it into the state table.
If that happens we delete the state again with pf_free_state(). However,
this asserts that the state must be unlinked.

It's correct to simply set the state to PFTM_UNLINKED because we've not
yet linked it.

Submitted by: Mateusz Guzik <mjg@FreeBSD.org>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable