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
F86130228: D31752.diff
Sat, Jun 15, 9:06 PM
Unknown Object (File)
Tue, May 28, 7:53 PM
Unknown Object (File)
May 15 2024, 11:20 AM
Unknown Object (File)
May 15 2024, 6:47 AM
Unknown Object (File)
May 8 2024, 10:06 AM
Unknown Object (File)
May 8 2024, 4:27 AM
Unknown Object (File)
May 1 2024, 6:18 PM
Unknown Object (File)
Apr 27 2024, 10:16 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