svn commit: r325916 - stable/11/sys/dev/vnic
Ed Maste
emaste at FreeBSD.org
Fri Nov 17 00:38:02 UTC 2017
Author: emaste
Date: Fri Nov 17 00:38:00 2017
New Revision: 325916
URL: https://svnweb.freebsd.org/changeset/base/325916
Log:
MFC r325683: vnic: apply BPF tap before passing packet to hardware
Previously we passed tx packets to hardware via nicvf_tx_mbuf_locked
and then to the BPF tap, with a possibly invalid mbuf which would result
in a panic.
PR: 223600
Discussed with: bz
Sponsored by: The FreeBSD Foundation, Packet.net (hardware)
Modified:
stable/11/sys/dev/vnic/nicvf_queues.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/vnic/nicvf_queues.c
==============================================================================
--- stable/11/sys/dev/vnic/nicvf_queues.c Thu Nov 16 23:36:19 2017 (r325915)
+++ stable/11/sys/dev/vnic/nicvf_queues.c Fri Nov 17 00:38:00 2017 (r325916)
@@ -992,6 +992,9 @@ nicvf_xmit_locked(struct snd_queue *sq)
err = 0;
while ((next = drbr_peek(ifp, sq->br)) != NULL) {
+ /* Send a copy of the frame to the BPF listener */
+ ETHER_BPF_MTAP(ifp, next);
+
err = nicvf_tx_mbuf_locked(sq, &next);
if (err != 0) {
if (next == NULL)
@@ -1002,8 +1005,6 @@ nicvf_xmit_locked(struct snd_queue *sq)
break;
}
drbr_advance(ifp, sq->br);
- /* Send a copy of the frame to the BPF listener */
- ETHER_BPF_MTAP(ifp, next);
}
return (err);
}
More information about the svn-src-stable-11
mailing list