| a6ea80bc | 15-Dec-2025 |
Cy Schubert <cy@FreeBSD.org> |
ipfilter: Add missing kenv fetch
When a module the environment must be explicitly fetched.
Fixes: d9788eabffa4 PR: 291548 Noted by: markj Reviewed by: markj Differential Revision: https://rev
ipfilter: Add missing kenv fetch
When a module the environment must be explicitly fetched.
Fixes: d9788eabffa4 PR: 291548 Noted by: markj Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54242 MFC after: 3 days
show more ...
|
| 821774df | 03-Nov-2025 |
Cy Schubert <cy@FreeBSD.org> |
ipfilter: Verify ipnat on entry into kernel
The ipnat struct is built by ipnat(8), specifically ipnat_y.y when parsing the ipnat configuration file (typically ipnat.conf). ipnat contains a variable
ipfilter: Verify ipnat on entry into kernel
The ipnat struct is built by ipnat(8), specifically ipnat_y.y when parsing the ipnat configuration file (typically ipnat.conf). ipnat contains a variable length string field at the end of the struct. This data field, called in_names, may contain various text strings such as NIC names. There is no upper bound limit to the length of strings as long as the in_namelen length field specifies the length of in_names within the ipnat structure and in_size specifies the size of the ipnat structure itself.
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53843
show more ...
|
| eda1756d | 29-Oct-2025 |
Cy Schubert <cy@FreeBSD.org> |
ipfilter: Verify frentry on entry into kernel
The frentry struct is built by ipf(8), specifically ipf_y.y when parsing the ipfilter configuration file (typically ipf.conf). frentry contains a variab
ipfilter: Verify frentry on entry into kernel
The frentry struct is built by ipf(8), specifically ipf_y.y when parsing the ipfilter configuration file (typically ipf.conf). frentry contains a variable length string field at the end of the struct. This data field, called fr_names, may contain various text strings such as NIC names, destination list (dstlist) names, and filter rule comments. The length field specifies the length of fr_names within the frentry structure and fr_size specifies the size of the frentry structure itself.
The upper bound limit to the length of strings field is controlled by the fr_max_namelen sysctl/kenv or the max_namelen ipfilter tuneable.
The initial concepts were discussed with emaste and jrm.
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53843
show more ...
|
| df381bec | 23-Oct-2025 |
Cy Schubert <cy@FreeBSD.org> |
ipfilter: Don't trust userland supplied iph_size
ipf_htable_create() trusts a user-supplied iph_size from iphtable_t and computes the allocation size as iph->iph_size * sizeof(*iph->iph_table) witho
ipfilter: Don't trust userland supplied iph_size
ipf_htable_create() trusts a user-supplied iph_size from iphtable_t and computes the allocation size as iph->iph_size * sizeof(*iph->iph_table) without checking for integer overflow. A sufficiently large iph_size causes the multiplication to wrap, resulting in an under-sized allocation for the table pointer array. Subsequent code (e.g., in ipf_htent_insert()) can then write past the end of the allocated buffer, corrupting kernel memory and causing DoS or potential privilege escalation.
This is not typically a problem when using the ipfilter provided userland tools as calculate the correct lengths. This mitigates a rogue actor calling ipfilter ioctls directly.
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53286
show more ...
|
| f3b94f47 | 23-Oct-2025 |
Cy Schubert <cy@FreeBSD.org> |
ipfilter: Add an htable max size tuneable.
Add an ipfilter runtime option (ipf -T) to adjust the default maximum hash table size. Default it to 1024 entries. It will be used by a subsequent commit t
ipfilter: Add an htable max size tuneable.
Add an ipfilter runtime option (ipf -T) to adjust the default maximum hash table size. Default it to 1024 entries. It will be used by a subsequent commit to limit any damage due to excessively large hash table input by the user.
Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53284
show more ...
|
| 0d589ecb | 22-Oct-2025 |
Cy Schubert <cy@FreeBSD.org> |
ipfilter: Plug ip_htable kernel information leak
ipf_htable_stats_get() constructs an iphtstat_t on the stack and only initializes select fields before copying the entire structure to userland. The
ipfilter: Plug ip_htable kernel information leak
ipf_htable_stats_get() constructs an iphtstat_t on the stack and only initializes select fields before copying the entire structure to userland. The trailing padding array iphs_pad[16] is never initialized, so ~128 bytes of uninitialized kernel stack memory can be leaked to user space on each call. This is a classic information disclosure vulnerability that can reveal pointers and other sensitive data.
We fix this by zeroing out the data structure prior to use.
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: emaste MFC after: 3 days Differential revision: https://reviews.freebsd.org/D53275
show more ...
|