Page MenuHomeFreeBSD

firewire: NULL check on malloc in fw_busreset()
ClosedPublic

Authored by guest-seuros on Sun, Jun 21, 8:21 PM.
Referenced Files
F160424961: D57728.diff
Wed, Jun 24, 8:00 AM
Unknown Object (File)
Mon, Jun 22, 5:51 PM
Unknown Object (File)
Sun, Jun 21, 11:09 PM
Subscribers

Details

Summary

fw_busreset() allocates newrom with M_NOWAIT from interrupt context.
If the allocation fails, crom_load() dereferences a NULL pointer.

Skip the config ROM comparison on allocation failure so the next bus
reset will retry.

Test Plan

Hard to reproduce reliably. Triggered by wiggling the cable on a
battery-powered FireWire camera, the intermittent connection causes
rapid bus resets that race with allocation, eventually hitting the
NULL path. Panic no longer occurs with the fix.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74085
Build 70968: arc lint + arc unit