Grab Giant after MAC processing on outgoing packets being sent via

BPF.  Grab the BPF descriptor lock before entering MAC since the MAC
Framework references BPF descriptor fields, including the BPF
descriptor label.

Submitted by:	sam
This commit is contained in:
Robert Watson 2004-02-29 15:32:33 +00:00
parent d0930e8695
commit f747d2dd90

View File

@ -578,10 +578,12 @@ bpfwrite(dev, uio, ioflag)
if (d->bd_hdrcmplt)
dst.sa_family = pseudo_AF_HDRCMPLT;
mtx_lock(&Giant);
#ifdef MAC
BPFD_LOCK(d);
mac_create_mbuf_from_bpfdesc(d, m);
BPFD_UNLOCK(d);
#endif
mtx_lock(&Giant);
error = (*ifp->if_output)(ifp, m, &dst, (struct rtentry *)0);
mtx_unlock(&Giant);
/*