From nobody Sun Oct 26 03:14:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cvMFB3rmJz6Dmxt; Sun, 26 Oct 2025 03:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cvMFB38B2z3Q7S; Sun, 26 Oct 2025 03:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761448478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J40aERZk1rloTd4o0I1m5ek5AX4JYFkxojbt+zy44VE=; b=a8LXbTcPcUvzMztzyTHppSL3JM+ZAYaF94UWFr9qRcx7j/8Zr1tTwcEptoQiXLaqsOYmDh pTafqYVsyyORrKStraqlR3Cr9vGCWHvNm4jZTd5tOg103LmF7f183NCOBLdkZya1XFEYZl RKqDIWCQ5S82t+vDwJJdIdmNpRnXACMJBHPkwqcEaN7K9ULryxRZ0SDTJba3/mVLrMZark SlTqC3VnKIxlaFHfSD18eFF5urC6wemOgIYzs4EbsdsNHAoLL+Ishvdel2a4o7Os8ddaLm RIxCRlJOtyrIBXMHA1KwfiZnXkbLyU1MkxFFGVnJ2PKvOnH5NYhLGkxyKdJz8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761448478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J40aERZk1rloTd4o0I1m5ek5AX4JYFkxojbt+zy44VE=; b=d+u30OzFH6mqdN4SE1EZu/wr4nC9J5lCrzpvySsOrbLUix5F19RLfr7g9W6sx2KmYEu1Xk Xv+km3N0fzvCO3cgkwIOwTysXkxR/PXEMl/XAjBK2USPKCjKwcLQMyLLKX8gcCFf6xEXWL n/pA0BeAsOzTnTGifqjNU3dSFXfq/ItPIVUu96f4WVyVV1zK4XSh4sIqWiW9pTRdUh71q4 6CFGn3OTH+X630tHMXUnPyh3IDM55TbSTpfXGMTSgRIVorAoWjDPjKb0C+dXRrxE5oUug9 urdw0NrpnP0mLj0SBoAIkEbwiqAc4yywwUoQCpGd5fnMyIXgIdvr63718dSzdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761448478; a=rsa-sha256; cv=none; b=npRPIFpNd3+J9CwSQ04SvtejV7y0d5vQCNKxBY2VcwklPW9nzrirRlwxsovKqGd+iHPuC2 2OZYgTHB7QVJftDZTSQjdAR+kiL7iTZnXRp12kg2ALk99efoB0lBMq7a2x+WuWj7i7g9m+ eUw0iAVEfDbHIl/mfwK4w2DD5IlTgWEzGbR9dLdsDVReQL9eXD62YTIYqrnzBCRLP32R+e rkhIVXshpMo6hiM+T5CQ4/IDsOX4zR/lSjrigT6AQHSe8xAyezqPYr0+KkPQfM8BbgK0p8 DzmvKewqsC3fokEAGwl+201VeeRXG8IYEJKUSJ3V2L4voqBJthSpkvLaoSfYLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cvMFB2YLTzWG; Sun, 26 Oct 2025 03:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59Q3Ecqi063267; Sun, 26 Oct 2025 03:14:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59Q3EcMw063264; Sun, 26 Oct 2025 03:14:38 GMT (envelope-from git) Date: Sun, 26 Oct 2025 03:14:38 GMT Message-Id: <202510260314.59Q3EcMw063264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: fcdc47e20959 - stable/15 - ipfilter: Plug ip_htable kernel information leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fcdc47e209590800020c958a966f258d8af143b1 Auto-Submitted: auto-generated The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fcdc47e209590800020c958a966f258d8af143b1 commit fcdc47e209590800020c958a966f258d8af143b1 Author: Cy Schubert AuthorDate: 2025-10-22 16:29:03 +0000 Commit: Cy Schubert CommitDate: 2025-10-26 03:14:08 +0000 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 Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D53275 (cherry picked from commit 0d589ecbc7aa916537fd21c0344919491cfcb293) --- sys/netpfil/ipfilter/netinet/ip_htable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index 91b375f80db1..3f765cfab947 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -230,6 +230,8 @@ ipf_htable_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) return (EINVAL); } + bzero(&stats, sizeof(stats)); + stats.iphs_tables = softh->ipf_htables[op->iplo_unit + 1]; stats.iphs_numtables = softh->ipf_nhtables[op->iplo_unit + 1]; stats.iphs_numnodes = softh->ipf_nhtnodes[op->iplo_unit + 1];