svn commit: r348303 - head/sys/net
Andrey V. Elsukov
bu7cher at yandex.ru
Wed May 29 00:23:30 UTC 2019
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 bd_writer value */
> error = d->bd_writer;
> ifp = bp->bif_ifp;
> - d->bd_bif = NULL;
> if (detached_ifp) {
> /*
> * Notify descriptor as it's detached, so that any
>
> Since every bpf_d holds a reference on bpf_if until delayed free happens,
> the the bpf_if is going to be valid.
>
> This allows not to use epoch_wait and run fully async. The patch above is
> a minimal patch: with NULL assignment removed, several more pieces of code
> can be removed in bpf.c
>
> Of course your patch also is going to work, but what do you think:
> are there any landmines with fully async approach?
Hi,
bpf_mtap() is not the only consumer of bd_bif, some of them expect it
becomes NULL when descriptor is detached.
--
WBR, Andrey V. Elsukov
More information about the svn-src-all
mailing list