Page MenuHomeFreeBSD

gve: fix kernel panic on attach failure
AcceptedPublic

Authored by jtranoleary_google.com on Mon, Oct 5, 10:02 PM.

Details

Reviewers
markj
adrian
Group Reviewers
network
Summary

When device initialization fails during attach (for instance, if device
resource configuration or firmware negotiation fails), the driver aborts
and unrolls partial state via its detach routine. However, the teardown
path assumes transmit and receive queues have already been created. If
attach aborts before queue allocation, tearing down the uninitialized
queues triggers a NULL pointer dereference and panics the kernel during
boot.

Guard queue teardown against uninitialized queue state so that early
attach failures unwind safely, allowing the driver to report the failure
gracefully without crashing the operating system.

Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77741
Build 74624: arc lint + arc unit