git: 545ab0eb1993 - stable/13 - gve: Fix Tx tcpdump panic
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 18 Aug 2023 23:18:48 UTC
The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=545ab0eb19931d8b2e978da18811f16b97b94c78 commit 545ab0eb19931d8b2e978da18811f16b97b94c78 Author: Shailend Chand <shailend@google.com> AuthorDate: 2023-07-27 05:22:31 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2023-08-18 23:18:16 +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 Differential Revision: https://reviews.freebsd.org/D41189 (cherry picked from commit 74861578d95573e13a2099143f9d4e7edbb82806) --- 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); } }