From nobody Thu Oct 23 22:56:42 2025 X-Original-To: dev-commits-src-main@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 4ct1cW0KnZz6Dn0d; Thu, 23 Oct 2025 22:56:43 +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 4ct1cV5sV8z3LPk; Thu, 23 Oct 2025 22:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761260202; 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=TXqIbiOU8i0nFnIjpoCoSr1u9XmaFbJhPhTNkhf8w48=; b=g6QjP/y2cjj+RCt9WJdrT6f2fqpAEWbnm0Lb+NvDLYKHEJkMpXFKQPVTKwUwLKQ9jmWbD0 5SaQczJFfhefoTfVt8aYkKIhqULTckI0J7IiCQKAdr3XI7GIQUDAezfN00e33rtKMcDob+ S5xKCGgVcAMXxjDLI3x3B2V/RvQboOqH167O6X3gkjPZfrPH7vzbBpvBlUm+0+MIxwIZgb zVbWlDRn2NCpjx42JS0zCTEGPUP63DgWYafQFLt3RRFrG7ogaxJjNFzyvrkNsarP4npQxy l0pXVjuJ8xfVnvcp/9JJnTLDOhc7WnB+XUMsewWmwc+2HdxfwXuY/SfxSXjQJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761260202; 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=TXqIbiOU8i0nFnIjpoCoSr1u9XmaFbJhPhTNkhf8w48=; b=OMrs83jSSitxCg2ke73JluW3Qx0m5ArGaUsCo2f+CcMSuuyukMnZoFgLRb60VdzOUFB/Xl u8sdCVwpyTMFsgrEbUoia9IkAgD6hIWZQXv3xoO62voa0+1ih1HwXkN3fLivtovs9x06VI D4AvqUlMF789E22MMcLUvzbFQteO8UBv++9DncDt5gt+DhI6SH2Cf36o+gxjsvhBKpv/9r oQQ3lYfxo/dttp4Xs4VmhKcFNhjZn+phdwOatIrBEubGVV2hebZjiL9jkTZnyr6cfIaVs6 y8iNcryJSkOHZrqvKp9hUtIEdxE9XvH5peqrlFSuJM0l/9KqqKdsoyzcr2H2EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761260202; a=rsa-sha256; cv=none; b=RVuEdEtac/Uj1astuPQF1w+Et/DWhr7FOzAYI798XUuC/0S3Gxc6OUcbEqjJnGDwoTqVAw uANJpngcjxn0KANceXKza2A/d6mHLuB8GIEDP8dmibhxO6nOd8llF7HlAPqfHHtpsGdMIO 5dddkQHesNj5sYu98YtKnMlRQX9izLw/A4ia4WVTcIYjtA92UUQifz8l6WNXZ8lLOqLy+t KordxKoZL7TwiViTt6XEewNK3EWXigykzzMb1a3JGLQ8wrNZthi7Ev+MpDrXfDQD3RX5Id lTB8npSWVtgYl+naklhmL2N2ZQrFDZ+F/dJya73pgVnYd4HcApaV8VQPP4qFfw== 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 4ct1cV5TGBzbD2; Thu, 23 Oct 2025 22:56:42 +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 59NMugkd049938; Thu, 23 Oct 2025 22:56:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59NMugNg049933; Thu, 23 Oct 2025 22:56:42 GMT (envelope-from git) Date: Thu, 23 Oct 2025 22:56:42 GMT Message-Id: <202510232256.59NMugNg049933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 0d589ecbc7aa - main - ipfilter: Plug ip_htable kernel information leak List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0d589ecbc7aa916537fd21c0344919491cfcb293 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0d589ecbc7aa916537fd21c0344919491cfcb293 commit 0d589ecbc7aa916537fd21c0344919491cfcb293 Author: Cy Schubert AuthorDate: 2025-10-22 16:29:03 +0000 Commit: Cy Schubert CommitDate: 2025-10-23 22:56:28 +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 MFC after: 3 days Differential revision: https://reviews.freebsd.org/D53275 --- 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];