Page MenuHomeFreeBSD

ipfilter: Plug ip_htable kernel information leak
ClosedPublic

Authored by cy on Oct 22 2025, 11:26 PM.
Tags
None
Referenced Files
F164705628: D53275.id164813.diff
Mon, Aug 3, 6:52 AM
F164683237: D53275.id164913.diff
Mon, Aug 3, 4:02 AM
F164660727: D53275.diff
Mon, Aug 3, 1:00 AM
Unknown Object (File)
Sun, Aug 2, 4:35 AM
Unknown Object (File)
Sun, Aug 2, 12:38 AM
Unknown Object (File)
Sat, Jul 25, 6:28 PM
Unknown Object (File)
Thu, Jul 23, 11:13 PM
Unknown Object (File)
Tue, Jul 21, 7:09 PM

Details

Summary

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>
MFC after: 1 day

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cy requested review of this revision.Oct 22 2025, 11:26 PM
This revision is now accepted and ready to land.Oct 22 2025, 11:55 PM

If you haven't tried testing ipf with the GENERIC-KMSAN kernel config, I suggest it: it'll automatically catch bugs of this kind. kmsan.9 has some details.

cy retitled this revision from ipfilter: Plug kernel information leak to ipfilter: Plug ip_htable kernel information leak.Oct 23 2025, 3:21 PM

If you haven't tried testing ipf with the GENERIC-KMSAN kernel config, I suggest it: it'll automatically catch bugs of this kind. kmsan.9 has some details.

I'm half way through creating patches. The reviews I've submitted have been fixed to build. I'll build a KMSAN kernel for the testbed and try the patches I do have here this afternoon.

This revision was automatically updated to reflect the committed changes.