git: 74861578d955 - main - gve: Fix Tx tcpdump panic
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 27 Jul 2023 05:37:12 UTC
The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=74861578d95573e13a2099143f9d4e7edbb82806 commit 74861578d95573e13a2099143f9d4e7edbb82806 Author: Shailend Chand <shailend@google.com> AuthorDate: 2023-07-27 05:22:31 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2023-07-27 05:36:42 +0000 gve: Fix Tx tcpdump panic Ringing the doorbell before making the BPF call can result in the mbuf being freed before the BPF call. Reviewed-by: markj MFC-after: 3 days Differential Revision: https://reviews.freebsd.org/D41189 --- sys/dev/gve/gve_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/gve/gve_tx.c b/sys/dev/gve/gve_tx.c index dd48bc35a258..db3f7415f412 100644 --- a/sys/dev/gve/gve_tx.c +++ b/sys/dev/gve/gve_tx.c @@ -706,12 +706,12 @@ gve_xmit_br(struct gve_tx_ring *tx) break; } + drbr_advance(ifp, tx->br); + BPF_MTAP(ifp, mbuf); + bus_dmamap_sync(tx->desc_ring_mem.tag, tx->desc_ring_mem.map, BUS_DMASYNC_PREWRITE); gve_db_bar_write_4(priv, tx->com.db_offset, tx->req); - - drbr_advance(ifp, tx->br); - BPF_MTAP(ifp, mbuf); } }