Page MenuHomeFreeBSD

Properly drain callouts in the IPFW subsystem

Authored by hselasky on Oct 9 2015, 12:30 PM.



When unloading the dummynet module, there is a slight chance that the dummynet timer might be restarted after the callout is drained. Add a drain variable and use an existing lock to ensure the dymmynet timer is not restarted after the teardown sequence is started.

Callout drain can sleep and must not be called locked.

Test Plan
while true
kldunload dummynet
kldunload ipfw
kldload ipfw
kldload dummynet

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

hselasky updated this revision to Diff 9273.Oct 9 2015, 12:30 PM
hselasky retitled this revision from to Properly drain callouts in the IPFW subsystem.
hselasky updated this object.
hselasky edited the test plan for this revision. (Show Details)
hselasky added reviewers: hiren, jch, rrs.
hselasky set the repository for this revision to rS FreeBSD src repository.
hiren accepted this revision.Dec 14 2015, 1:34 PM
hiren edited edge metadata.

I am not 100% sure if this is the correct approach but its better than whats going on right now. Please go ahead with this patch.
Rasool Al-Saadi also confirmed that this works and avoids panic.

This revision is now accepted and ready to land.Dec 14 2015, 1:34 PM
This revision was automatically updated to reflect the committed changes.

I just hit this and noticed it was never MFC'd. Can this be pushed to STABLE?

Feel free to MFC if the patches apply to 10-stable. I won't be able to MFC until end of next week.

Ok, I'll open a bug report for the MFC.

FWIW, applies cleanly to 10.2-RELENG and kldunload works as expected, thanks for this patch!