/[base]
ViewVC logotype

Revision 322590


Jump to revision: Previous Next
Author: kp
Date: Wed Aug 16 19:40:07 2017 UTC (6 years, 10 months ago)
Changed paths: 1
Log Message:
bpf: Fix incorrect cleanup

Cleaning up a bpf_if is a two stage process. We first move it to the
bpf_freelist (in bpfdetach()) and only later do we actually free it (in
bpf_ifdetach()).

We cannot set the ifp->if_bpf to NULL from bpf_ifdetach() because it's
possible that the ifnet has already gone away, or that it has been assigned
a new bpf_if.
This can lead to a struct ifnet which is up, but has if_bpf set to NULL,
which will panic when we try to send the next packet.

Keep track of the pointer to the bpf_if (because it's not always
ifp->if_bpf), and NULL it immediately in bpfdetach().

PR:		213896
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11782


Changed paths

Path Details
Directoryhead/sys/net/bpf.c modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.27