Page MenuHomeFreeBSD

sack_filter: sack_filter_reject underflow guard
Needs ReviewPublic

Authored by thebugfixers_pm.me on Jun 24 2026, 11:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 13, 1:49 AM
Unknown Object (File)
Mon, Aug 10, 1:11 PM
Unknown Object (File)
Mon, Aug 10, 9:42 AM
Unknown Object (File)
Mon, Aug 10, 9:37 AM
Unknown Object (File)
Sat, Aug 8, 9:23 AM
Unknown Object (File)
Sat, Aug 8, 3:08 AM
Unknown Object (File)
Fri, Aug 7, 2:46 AM
Unknown Object (File)
Thu, Aug 6, 8:19 PM

Details

Summary

If two board entries share the same .end or .start the loop clears both bits and decrements sf_used twice.
Protect by using MPASS(sf->sf_used > 0); in front of the decrement.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I think this patch would just hide bugs related to the accounting done using sf_used. There are four occurrences of sf->sf_used--. You might want to protect all of them by adding MPASS(sf->sf_used > 0); in front of the decrement.

tuexen requested changes to this revision.Jun 28 2026, 12:03 PM
tuexen added a reviewer: tuexen.
This revision now requires changes to proceed.Jun 28 2026, 12:03 PM
thebugfixers_pm.me edited the summary of this revision. (Show Details)

Thanks for the review. Fair point. Revised diff and summary accordingly.