Page MenuHomeFreeBSD

sack_filter: sack_filter_reject underflow guard
Needs ReviewPublic

Authored by thebugfixers_pm.me on Wed, Jun 24, 11:08 AM.
Tags
None
Referenced Files
F161911674: D57814.id180522.diff
Tue, Jul 7, 11:14 PM
F161907242: D57814.diff
Tue, Jul 7, 10:17 PM
F161880310: D57814.id180878.diff
Tue, Jul 7, 4:34 PM
Unknown Object (File)
Sun, Jul 5, 8:44 PM
Unknown Object (File)
Sun, Jul 5, 8:40 PM
Unknown Object (File)
Sun, Jul 5, 5:58 PM
Unknown Object (File)
Sun, Jul 5, 5:39 PM
Unknown Object (File)
Sun, Jul 5, 5:35 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.Sun, Jun 28, 12:03 PM
tuexen added a reviewer: tuexen.
This revision now requires changes to proceed.Sun, Jun 28, 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.