[Bug 204005] [patch][pf] PF_ANEQ macro improperly compare IPv4 packets.

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Oct 24 17:17:18 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204005

            Bug ID: 204005
           Summary: [patch][pf] PF_ANEQ macro improperly compare IPv4
                    packets.
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: milosz.kaniewski at gmail.com
          Keywords: patch

Created attachment 162429
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=162429&action=edit
patch

PF_ANEQ() macro will in most situations returns TRUE comparing two identical
IPv4 packets (when it should return FALSE). It happens because PF_ANEQ()
doesn't stop if first 32 bits of IPv4 packets are equal and starts to check
next 3*32 bits (like for IPv6 packet). Those bits containt some garbage and in
result PF_ANEQ() wrongly returns TRUE.

Fix: Check if packet is of AF_INET type and if it is then compare only first 32
bits of data.
Proposed fix in attachment.

This bug was already described and repaired in OpenBSD pf:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/net/pfvar.h?f=h#rev1.287

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list