History log of /freebsd-10.0-release/sys/net/bpf_filter.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 224044 14-Jul-2011 mp

Clear the filter memory area before using it. Leaving it uninitialized may
leak previous kernel stack contents through a malicioius BPF filter.

PR: kern/158880
Submitted by: Guy Harris
Obtained from: OpenBSD
MFC after: 1 week


# 182456 29-Aug-2008 jkim

Fix the last missing parentheses for a return statement in bpf_filter.c.


# 182455 29-Aug-2008 jkim

More convergence towards style(9).


# 182454 29-Aug-2008 jkim

- Directly match code wherever possible instead of using macros.
- Macrofy bitmap table lookup. Constify the table while I am here.
- Add missing continue statements in the for loop.

Functionally it should be the last remaining fix from:

PR: kern/89752
MFC after: 1 month


# 182425 28-Aug-2008 jkim

Simplify jump instruction range checks.

MFC after: 1 month


# 182412 28-Aug-2008 jkim

Check invalid BPF codes from bpf_validate(9).

Note that it is not critical because bpf_filter(9) returns zero
when it encounters invalid code at run time.

MFC after: 1 month


# 182380 28-Aug-2008 jkim

Validate scratch memory addresses for BPF_STX and BPF_LDX|BPF_MEM.
A badly written filter was able to reference invalid addresses,
even cause kernel crash.

MFC after: 3 days


# 182184 25-Aug-2008 jkim

Make sys/net/bpf_filter.c build cleanly on user land.


# 177003 09-Mar-2008 rwatson

Improve convergence of bpf_filter.c toward style(9).

MFC after: 3 weeks
Submitted by: csjp


# 174895 25-Dec-2007 rwatson

Use __FBSDID() in the kernel BPF implementation.

MFC after: 3 days


# 172154 13-Sep-2007 dwmalone

Make the type of the memory used by the BPF filter unsigned, so it
matches the BPF registers (which are the only thing that is assigned
to/from BPF memory). This is a pedantic change that shouldn't change
any behaviour.

PR: 115931
Submitted by: Matthew Luckie <mjl@luckie.org.nz>
Approved by: re (bmah)
MFC after: 3 weeks


# 159018 28-May-2006 dwmalone

Avoid unwanted sign extension of indexed byte load in bpf code.

PR: 89748
Submitted by: Guy Harris <guy@alum.mit.edu>
Obtained from: NetBSD via OpenBSD
MFC after: 2 weeks


# 153996 03-Jan-2006 jkim

Correctly check the filter length. I committed the wrong version.
Pointy hat to me.


# 153995 03-Jan-2006 jkim

- Explicitly validate an empty filter to match bpf_filter() comment[1].
- Do not use BPF JIT compiler for an empty filter.

[1] Pointed out by: darrenr


# 153221 07-Dec-2005 jkim

Do not accept an empty bpf program.


# 139823 06-Jan-2005 imp

/* -> /*- for license, minor formatting changes


# 128019 07-Apr-2004 imp

Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson


# 99419 04-Jul-2002 peter

Turn on BPF_ALIGN for all non-i386 platforms, instead of having an
ifdef list that currently lists all the non-i386 platforms that bpf
currently works on.


# 92725 19-Mar-2002 alfred

Remove __P.


# 88659 29-Dec-2001 jake

sparc64 needs the same alignment fixes that ia64 and alpha need.

Submitted by: tmm


# 84558 05-Oct-2001 dfr

Add ia64 to the list of machines which don't do unaligned reads.


# 55205 29-Dec-1999 peter

Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot). This is consistant with the other
BSD's who made this change quite some time ago. More commits to come.


# 54038 02-Dec-1999 archie

Add 'const' to the bpf_filter() and bpf_validate() prototypes.
Remove a stale comment from bpf_validate().


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48548 04-Jul-1999 bde

Quick fix for breakage of bounds checking in rev.1.12. Only one
of the additional checks in rev.1.12 was wrong. The others are a
bit inconsistent and are probably unnecessarily pessimal. Checking
for overflow of addition, if necessary at all, should be done in
bpf_validate().

PR: 12484


# 45574 11-Apr-1999 eivind

Break long lines that I introduced in a previous commit.


# 41588 07-Dec-1998 eivind

Propagate unsignedness to all variants of 'k', and reorganize the
conditionals to be fully resistent against overflow in unsigned
computations.

Potential problem pointed out by: bde
Reviewed by: bde


# 41571 07-Dec-1998 eivind

Remove guard for < 0 on an unsigned variable.


# 40779 31-Oct-1998 dfr

* Use explicitly sized types for grovelling around inside packets.
* On the alpha, make sure memory accesses are only made to aligned boundaries.

Submitted by: Alex Nash <nash@mcs.net>


# 27845 02-Aug-1997 bde

Removed unused #includes.


# 22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 12579 02-Dec-1995 bde

Completed function declarations and/or added prototypes.


# 8876 30-May-1995 rgrimes

Remove trailing whitespace.


# 7543 31-Mar-1995 dg

Patch from Greg Ansley:

In rare cases, when the filter specified accesses an multi-byte value that
is split across mbuf's, the value loaded is incorrect. And if you are very
unlucky (like me) it will index off the end of the mbuf and into an
unallocated page and panic the system.

If you look at the code you will discover the the index *k* is added to
the pointer *cp* and the used AGAIN as a subscript.


# 1817 02-Aug-1994 dg

Added $Id$


# 1549 25-May-1994 rgrimes

The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by: Rodney W. Grimes
Submitted by: John Dyson and David Greenman


# 1542 24-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1541,
which included commits to RCS files with non-trunk default branches.


# 1541 24-May-1994 rgrimes

BSD 4.4 Lite Kernel Sources