On Wed, May 29, 2019 at 08:56:23PM +0300, Andrey V. Elsukov wrote:
A> On 29.05.2019 06:12, Gleb Smirnoff wrote:
A> > A> bpf_mtap() is not the only consumer of bd_bif, some of them expect it
A> > A> becomes NULL when descriptor is detached.
A> >
A> > May be then make a flag attached/detached?
A>
On 29.05.2019 06:12, Gleb Smirnoff wrote:
> A> bpf_mtap() is not the only consumer of bd_bif, some of them expect it
> A> becomes NULL when descriptor is detached.
>
> May be then make a flag attached/detached?
Do you have benchmark results that show some benefits in performance? :)
I prefer to
On Wed, May 29, 2019 at 03:23:23AM +0300, Andrey V. Elsukov wrote:
A> > --- a/FreeBSD/sys/net/bpf.c
A> > +++ b/FreeBSD/sys/net/bpf.c
A> > @@ -857,7 +857,6 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp)
A> > /* Save bd_writer value */
A> > error = d->bd_writer;
A> >
29.05.2019 3:10, Gleb Smirnoff пишет:
> Hi Andrey,
>
> I made a different change to mitigate this panic: don't clear the pointer.
>
> --- a/FreeBSD/sys/net/bpf.c
> +++ b/FreeBSD/sys/net/bpf.c
> @@ -857,7 +857,6 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp)
> /* Save
Hi Andrey,
I made a different change to mitigate this panic: don't clear the pointer.
--- a/FreeBSD/sys/net/bpf.c
+++ b/FreeBSD/sys/net/bpf.c
@@ -857,7 +857,6 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp)
/* Save bd_writer value */
error = d->bd_writer;
ifp
Author: ae
Date: Mon May 27 12:41:41 2019
New Revision: 348303
URL: https://svnweb.freebsd.org/changeset/base/348303
Log:
Fix possible NULL pointer dereference.
bpf_mtap() can invoke catchpacket() for already detached descriptor.
And this can lead to NULL pointer dereference, since