CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2020/12/16 11:00:44

Modified files:
        sbin/pfctl     : parse.y 
        sys/net        : pf_ioctl.c 

Log message:
Reject rules with invalid port ranges

Ranges where the left boundary is bigger than the right one are always bogus
as they work like `port any' (`port 34<>12' means "all ports") or in way
that inverts the rule's action (`pass ... port 34:12' means "pass no port at
all").

Add checks for all ranges and invalidate those that yield no or all ports.

For this to work on redirections, make pfctl(8) pass the range's type,
otherwise boundary including ranges are not detected as such;  that is to
say, `struct pf_pool's `port_op' member was unused in the kernel so far.

`rdr-to' rules with invalid ranges could panic the kernel when hit.
Reported-by: [email protected]

OK sashan

Reply via email to