History log of /freebsd-current/sys/net/bpf_filter.c
Revision Date Author Comments
# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 29363fb4 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 8a153724 04-Sep-2022 Gordon Bergling <gbe@FreeBSD.org>

bpf(3): Grammar fix for a source code comment

- s/that that/that the/

MFC after: 3 days


# 51369649 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# 3e85b721 16-May-2017 Ed Maste <emaste@FreeBSD.org>

Remove register keyword from sys/ and ANSIfy prototypes

A long long time ago the register keyword told the compiler to store
the corresponding variable in a CPU register, but it is not relevant
for any compiler used in the FreeBSD world today.

ANSIfy related prototypes while here.

Reviewed by: cem, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10193


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 69d410ee 21-Oct-2016 Jung-uk Kim <jkim@FreeBSD.org>

Implement BPF_MOD and BPF_XOR instructions.

These two ALU instructions first appeared on Linux. Then, libpcap adopted
and made them available since 1.6.2. Now more platforms including NetBSD
have them in kernel. So do we.
--이 줄 이하는 자동으로 제거됩니다--


# 155d72c4 15-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/net* : for pointers replace 0 with NULL.

Mostly cosmetical, no functional change.

Found with devel/coccinelle.


# b6d88aa3 19-Mar-2014 Julio Merino <jmmv@FreeBSD.org>

Include strings.h so that bpf_filter.c can be built in userland.

This is to bring in a definition for bzero(3), which in turn allows the
tests in tools/regression/bpf/ to build again.


# a4980a95 14-Jul-2011 Mark Peek <mp@FreeBSD.org>

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


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# b87fd66b 29-Aug-2008 Jung-uk Kim <jkim@FreeBSD.org>

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


# 7c5db425 29-Aug-2008 Jung-uk Kim <jkim@FreeBSD.org>

More convergence towards style(9).


# 07e7d737 29-Aug-2008 Jung-uk Kim <jkim@FreeBSD.org>

- 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


# 28ae62aa 28-Aug-2008 Jung-uk Kim <jkim@FreeBSD.org>

Simplify jump instruction range checks.

MFC after: 1 month


# 46e4a5d5 28-Aug-2008 Jung-uk Kim <jkim@FreeBSD.org>

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


# 8cfdb2fb 28-Aug-2008 Jung-uk Kim <jkim@FreeBSD.org>

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


# 32688992 25-Aug-2008 Jung-uk Kim <jkim@FreeBSD.org>

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


# 23a0c230 09-Mar-2008 Robert Watson <rwatson@FreeBSD.org>

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

MFC after: 3 weeks
Submitted by: csjp


# c7866007 25-Dec-2007 Robert Watson <rwatson@FreeBSD.org>

Use __FBSDID() in the kernel BPF implementation.

MFC after: 3 days


# b2adf5c8 13-Sep-2007 David Malone <dwmalone@FreeBSD.org>

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


# a58327bd 28-May-2006 David Malone <dwmalone@FreeBSD.org>

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


# 142f81c2 03-Jan-2006 Jung-uk Kim <jkim@FreeBSD.org>

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


# dccb7faf 03-Jan-2006 Jung-uk Kim <jkim@FreeBSD.org>

- 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


# 200bc1f0 07-Dec-2005 Jung-uk Kim <jkim@FreeBSD.org>

Do not accept an empty bpf program.


# c398230b 06-Jan-2005 Warner Losh <imp@FreeBSD.org>

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


# f36cfd49 07-Apr-2004 Warner Losh <imp@FreeBSD.org>

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


# a5ac5be2 04-Jul-2002 Peter Wemm <peter@FreeBSD.org>

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.


# 929ddbbb 19-Mar-2002 Alfred Perlstein <alfred@FreeBSD.org>

Remove __P.


# b0e00dba 29-Dec-2001 Jake Burkholder <jake@FreeBSD.org>

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

Submitted by: tmm


# 23620bde 05-Oct-2001 Doug Rabson <dfr@FreeBSD.org>

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


# 664a31e4 28-Dec-1999 Peter Wemm <peter@FreeBSD.org>

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.


# dcb129d5 02-Dec-1999 Archie Cobbs <archie@FreeBSD.org>

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


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# edff6990 04-Jul-1999 Bruce Evans <bde@FreeBSD.org>

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


# d108ff0b 10-Apr-1999 Eivind Eklund <eivind@FreeBSD.org>

Break long lines that I introduced in a previous commit.


# f865e453 07-Dec-1998 Eivind Eklund <eivind@FreeBSD.org>

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


# c4b7d2b6 06-Dec-1998 Eivind Eklund <eivind@FreeBSD.org>

Remove guard for < 0 on an unsigned variable.


# 171f44d7 31-Oct-1998 Doug Rabson <dfr@FreeBSD.org>

* 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>


# 1fd0b058 02-Aug-1997 Bruce Evans <bde@FreeBSD.org>

Removed unused #includes.


# 6875d254 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

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


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

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.


# ce7609a4 02-Dec-1995 Bruce Evans <bde@FreeBSD.org>

Completed function declarations and/or added prototypes.


# 9b2e5354 30-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# b4fff2ae 31-Mar-1995 David Greenman <dg@FreeBSD.org>

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.


# 3c4dd356 02-Aug-1994 David Greenman <dg@FreeBSD.org>

Added $Id$


# 26f9a767 25-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

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

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


# df8bae1d 24-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Kernel Sources