freebsd-src/sbin/ipf
Dag-Erling Smørgrav a34c50fbd2 ipfilter: Prevent stack buffer overflow
When copying ipfs data from user space, don't just check that the payload
length is nonzero, but also that it does not exceed the size of the stack
buffer we're copying it into.

While we're at it, use a union to create a buffer of the exact size we
need instead of guessing that 2048 will be enough (and not too much).

Finally, check the size of the payload once it gets to where it's used.

MFC after:	3 days
Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by:	cy
Differential Revision:	https://reviews.freebsd.org/D54194
2025-12-16 17:12:36 +01:00
..
common tcp: add TH_AE capabilities to ppp and pf 2024-11-29 10:04:31 +01:00
ipf tcp: add TH_AE capabilities to ppp and pf 2024-11-29 10:04:31 +01:00
ipfs ipfs: Fix typo in error message 2025-10-27 20:43:14 -07:00
ipfstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ipfsync sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
ipftest tcp: add TH_AE capabilities to ppp and pf 2024-11-29 10:04:31 +01:00
iplang tcp: cleanup of nits after use of accessor tcp_get_flags 2024-12-19 16:37:24 +01:00
ipmon tcp: add TH_AE capabilities to ppp and pf 2024-11-29 10:04:31 +01:00
ipnat man: Remove references to classful networks 2025-02-04 22:27:21 +01:00
ippool ipf: Correct ippool.5 man page 2025-03-04 12:39:07 -08:00
ipresend Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ipscan manuals: fix "PP after SS | SH" warnings 2024-11-14 16:59:43 -04:00
ipsend Don't include netinet/tcp_timer.h when not needed 2025-06-17 06:07:13 +02:00
libipf ipfilter: Prevent stack buffer overflow 2025-12-16 17:12:36 +01:00
Makefile ipfilter: Disable ipfs(8) by default 2025-12-08 08:15:18 -08:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00