Page MenuHomeFreeBSD

Properly drain callouts in the IPFW subsystem
ClosedPublic

Authored by hselasky on Oct 9 2015, 12:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 31 2023, 9:28 AM
Unknown Object (File)
Dec 31 2023, 9:27 AM
Unknown Object (File)
Dec 19 2023, 8:50 PM
Unknown Object (File)
Nov 20 2023, 7:32 AM
Unknown Object (File)
Oct 19 2023, 8:59 PM
Unknown Object (File)
Sep 13 2023, 6:41 PM
Unknown Object (File)
Jun 28 2023, 5:52 AM
Unknown Object (File)
Jun 25 2023, 3:59 PM

Details

Summary

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
#!/bin/sh
while true
do
kldunload dummynet
kldunload ipfw
kldload ipfw
kldload dummynet
done

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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 - subversion.
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!