Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2019 14:07:02 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r347527 - head/sys/net
Message-ID:  <201905131407.x4DE72Bu003611@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon May 13 14:07:02 2019
New Revision: 347527
URL: https://svnweb.freebsd.org/changeset/base/347527

Log:
  Do not leak memory used for binary filter.

Modified:
  head/sys/net/bpf.c

Modified: head/sys/net/bpf.c
==============================================================================
--- head/sys/net/bpf.c	Mon May 13 13:45:28 2019	(r347526)
+++ head/sys/net/bpf.c	Mon May 13 14:07:02 2019	(r347527)
@@ -2628,11 +2628,17 @@ bpfd_free(epoch_context_t ctx)
 	if (d->bd_rfilter != NULL) {
 		p = __containerof((void *)d->bd_rfilter,
 		    struct bpf_program_buffer, buffer);
+#ifdef BPF_JITTER
+		p->func = d->bd_bfilter;
+#endif
 		bpf_program_buffer_free(&p->epoch_ctx);
 	}
 	if (d->bd_wfilter != NULL) {
 		p = __containerof((void *)d->bd_wfilter,
 		    struct bpf_program_buffer, buffer);
+#ifdef BPF_JITTER
+		p->func = NULL;
+#endif
 		bpf_program_buffer_free(&p->epoch_ctx);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905131407.x4DE72Bu003611>