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
Unknown Object (File)
Wed, May 8, 10:06 AM
Unknown Object (File)
Wed, May 8, 4:27 AM
Unknown Object (File)
Wed, May 1, 6:18 PM
Unknown Object (File)
Sat, Apr 27, 10:16 AM
Unknown Object (File)
Tue, Apr 16, 2:46 PM
Unknown Object (File)
Apr 13 2024, 12:28 AM
Unknown Object (File)
Apr 7 2024, 1:43 AM
Unknown Object (File)
Jan 13 2024, 9:44 AM

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