HomeFreeBSD

ipfilter: Interface name must not extend beyond end of buffer

Description

ipfilter: Interface name must not extend beyond end of buffer

sifpidx (an interface name) cannot extend beyond the end of the
fr_names buffer.

We do the validation for fr_sifpidx here because it is a union that
contains an offset only when fr_sifpidx points to an interface name,
an offset into fr_names. The union is an offset into fr_names in this
case only.

interr_tbl now becomes a static variable outside a function to facilitate
its use by two functions within fil.c

Note that sifpidx is only used in ipf_sync() which implments ipf -y.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after: 1 week

(cherry picked from commit 47fb51847fdea3f1cce841b5f2bbbcd6f8a04ee0)

Details

Provenance
cyAuthored on Jan 8 2026, 5:41 PM
Parents
rGdda404ebddf2: ipfilter: Fix possible overrun
Branches
Unknown
Tags
Unknown