Page MenuHomeFreeBSD

gve: Fix Tx tcpdump panic
ClosedPublic

Authored by shailend_google.com on Jul 26 2023, 12:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 28, 4:07 PM
Unknown Object (File)
Tue, Apr 28, 4:03 PM
Unknown Object (File)
Sun, Apr 26, 11:49 AM
Unknown Object (File)
Sat, Apr 25, 11:48 PM
Unknown Object (File)
Sat, Apr 25, 1:04 PM
Unknown Object (File)
Sat, Apr 25, 11:49 AM
Unknown Object (File)
Sat, Apr 25, 2:38 AM
Unknown Object (File)
Mon, Apr 20, 4:24 AM
Subscribers
None

Details

Summary

Ringing the doorbell before making the BPF call can result in the
mbuf being freed before the BPF call.

Diff Detail

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

Event Timeline

shailend_google.com created this revision.
sys/dev/gve/gve_tx.c
709

BTW, this usage of drbr looks like it could be a bit simpler:

while ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0 && (m = drbr_peek()) != NULL) {
    if (gve_xmit(tx, mbuf) != 0) {
        ...
    }
    drbr_advance(ifp, tx->br);
    ...
}

Right now we're needlessly checking for an empty ring in drbr_peek() after having already done so with drbr_empty().

This revision is now accepted and ready to land.Jul 26 2023, 2:33 PM
This revision was automatically updated to reflect the committed changes.