CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2026/09/07 02:53:59

Modified files:
        lib/libpcap    : optimize.c 
        sys/net        : bpf_filter.c 

Log message:
Fix various minor things in our bpf implementation

In userland it is possible to call bpf_filter / pcap_offline_filter
with unverified bpf programs. Because of this harden bpf_filter further
by adding the following extra checks:

- Ensure that load and store operations to the scratch memory store are
always bound checked.
- Ensure that no division or modulo by zero is done.
- No longer do shift operations with a too large shift exponent. Instead
zero out the result.
- No longer call abort on unknown instructions when bpf_filter is run
in userland. Use the same return 0 as is already done in the kernel.

On top of this ensure that no unhandled instruction encoding makes it
through bpf_validate by using the same case handling as bpf_filter.

This are fixes for libpcap CVE-2026-0799, CVE-2026-6244, CVE-2026-6554,
CVE-2026-31911.  None of the above CVEs are applicable to or kernel since
it always calls bpf_validate beforehands.
cvs: ----------------------------------------------------------------------

Reply via email to