diff options
| author | Andrew Griffiths <andrew@calif.io> | 2026-09-06 20:44:35 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-09-25 16:50:42 +0000 |
| commit | cb035c19c3e76d547eb7d4bca1f1106b117c27a0 (patch) | |
| tree | 196bdf1dd03b7c66ef31f48d854dc8d0d750b1bf | |
| parent | 4523cbbfef79eb63e287d9ebd88d9f3ebd885ba1 (diff) | |
ipfilter: fix inverted range check on the lookup iterator unit
ipf_lookup_iterate() validates iter.ili_unit with
if (iter.ili_unit < IPL_LOGALL && iter.ili_unit > IPL_LOGMAX)
or alternatively,
if (iter.ili_unit < -1 && iter.ili_unit > 7)
ipf_lookup_add(), ipf_lookup_delete(), ipf_lookup_stats()
ipf_lookup_flush() validate with a ||
Submitted by calif.io for the OpenAI Patch The Planet program
Signed-off-by: Andrew Griffiths <andrew@calif.io>
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59726
| -rw-r--r-- | sys/netpfil/ipfilter/netinet/ip_lookup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netpfil/ipfilter/netinet/ip_lookup.c b/sys/netpfil/ipfilter/netinet/ip_lookup.c index a52dbef00166..b0fb2b09c325 100644 --- a/sys/netpfil/ipfilter/netinet/ip_lookup.c +++ b/sys/netpfil/ipfilter/netinet/ip_lookup.c @@ -663,7 +663,7 @@ ipf_lookup_iterate(ipf_main_softc_t *softc, void *data, int uid, void *ctx) if (err != 0) return (err); - if (iter.ili_unit < IPL_LOGALL && iter.ili_unit > IPL_LOGMAX) { + if (iter.ili_unit < IPL_LOGALL || iter.ili_unit > IPL_LOGMAX) { IPFERROR(50038); return (EINVAL); } |
