/[base]
ViewVC logotype

Revision 323034


Jump to revision: Previous Next
Author: kp
Date: Wed Aug 30 21:18:56 2017 UTC (6 years, 10 months ago)
Changed paths: 2
Log Message:
MFC r322590: 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
Differential Revision:	https://reviews.freebsd.org/D11782


Changed paths

Path Details
Directorystable/11/ modified , props changed
Directorystable/11/sys/net/bpf.c modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.27