Page MenuHomeFreeBSD

Fix possible double free in bwn_{dma,pio}_tx_start().
ClosedPublic

Authored by markj on Nov 26 2018, 2:37 PM.
Tags
None
Referenced Files
F102993985: D18342.id51118.diff
Tue, Nov 19, 2:37 PM
Unknown Object (File)
Tue, Nov 19, 1:49 AM
Unknown Object (File)
Mon, Nov 18, 5:00 PM
Unknown Object (File)
Mon, Nov 18, 2:41 PM
Unknown Object (File)
Wed, Nov 13, 2:44 PM
Unknown Object (File)
Fri, Nov 8, 2:49 AM
Unknown Object (File)
Fri, Oct 25, 12:53 AM
Unknown Object (File)
Tue, Oct 22, 5:55 AM
Subscribers

Details

Summary

The caller of bwn_{dma,pio}_tx_start() frees the mbuf if the call fails.
The tx_start routines may call m_defrag() which frees the input mbuf
chain upon success; if the routines fail after successfully calling
m_defrag(), we will free the mbuf chain twice.

Test Plan

None; I don't have any hardware which uses this driver.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 21510
Build 20823: arc lint + arc unit

Event Timeline

markj added a reviewer: landonf.

This looks good to me; I'll try to test on real hardware over the weekend, just to be sure.

This looks good to me; I'll try to test on real hardware over the weekend, just to be sure.

Thanks!

Sorry to nag, but did you get a chance to test this?

Sorry to nag, but did you get a chance to test this?

Apologies, wasn't able to get to it until tonight; other than the small KASSERT ordering issue, everything seems to be fine on a real hardware.

  • Fix assert ordering issue.

Sorry to nag, but did you get a chance to test this?

Apologies, wasn't able to get to it until tonight; other than the small KASSERT ordering issue, everything seems to be fine on a real hardware.

Thanks. Not sure how the assert issue slipped through build testing, but the latest upload fixes it.

This revision is now accepted and ready to land.Dec 12 2018, 5:01 AM
This revision was automatically updated to reflect the committed changes.