From nobody Sun Oct 26 03:14:39 2025 X-Original-To: dev-commits-src-branches@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 4cvMFC5VYwz6Dn2y; Sun, 26 Oct 2025 03:14:39 +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 4cvMFC3ttTz3PxD; Sun, 26 Oct 2025 03:14:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761448479; 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=3RE7ITka46cfsmPxSaQ14lEGMsIkhzNf8prUz1GaEbQ=; b=h1BOijNjPzQfc4+H8noD0L6zkWBQ55WA81DZu6BVHGvKoTmSrpLGVnmEAVv139B0+7L26P zNQz26vIU5vTjC0hsfx5tmeWRay/idgOTWIF1aOLywFy+mdBG8kdFPqKW7oeu+xeVpN4pU FHEC0uo9cX/gRIfcvPZBXA6Q6YsC/HPj1Xhy+rFsqvTJi43hCVI4cZxmlUmf6045cx+XwK XIncagob5/thGUcb4s+I0eQ0roFg9kX3sKFaS04LV1rdo0fuiwrtyS6EXpvxWZqqSY7QBZ F78tv+xv0N8FvpPGnW3RTAiEdPwZgesjLzheD+mfYcO9GY0MZCf21HOT1w1h9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761448479; 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=3RE7ITka46cfsmPxSaQ14lEGMsIkhzNf8prUz1GaEbQ=; b=ecg4I0J0jpaAQoRmDOPXALvZr0wSBfYsy6TwYL6FrH0ShnNuKQtq/BjsQ4lwi3KB/pMKC9 WrG/2e1fN1HfbAboJWuAghQ9KZLoKvF4IIafCc/MOsVWENm+rh8K8HtkeVo805vgzd8m0e hU+P4R61+siJN5W08Cj4Hn0y0vCSS1vBztCJ3JxFrbTWIIWq8LgUxUXqNMUMjKU4hL2omo RAVQEJzVqzmD+2gjSI5b62vNm2q7kI6ZOQC4zjYW2R5Bgb8YmkYwF/bSmkIsqJFmHCZfJQ dJCL8SJXX/lC9OYP0qGaYBMN8c3lB0wH4F1IWl/oTTlUXzTKKlDwTWqJsAeVfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761448479; a=rsa-sha256; cv=none; b=RBr/E4y/OrwtJ9IyZeo9PXl94l4P7QPsX9GZlCyXQpbcuYkZKm+irFnnDK7dgmQeo53ToD ij7De9hK8cvGfnch+erwl4+b87Ayz7N6CiVO4KXH3EYl7K8P1Z1CSFQQRCybZsPugh+im6 kmTnmVS4KQYZaqs/cccnnHGHZolfElq8bdzHwhJdqZ7z7Mao8rW1eJPXxg1XMc9SU74B8F +E+qbxfag9RHDOUQRl0zj6PO3HrbfPkKgeD/Tt5zUrN00Thouftog6t7EIZ2qRYicSz5Ua k7mM7/TvBqp11HHUbu/whF39Odet4JR0hrTiTUl8VaFpY2TTYgr/4SKpRpeLCA== 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 4cvMFC3SpGz16p; Sun, 26 Oct 2025 03:14:39 +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 59Q3Ed3I063303; Sun, 26 Oct 2025 03:14:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59Q3EdhO063300; Sun, 26 Oct 2025 03:14:39 GMT (envelope-from git) Date: Sun, 26 Oct 2025 03:14:39 GMT Message-Id: <202510260314.59Q3EdhO063300@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: d3b0843d2cec - stable/15 - ipfilter: Plug ip_nat kernel information leak List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: d3b0843d2cec1650e837c421e39532db24d49714 Auto-Submitted: auto-generated The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d3b0843d2cec1650e837c421e39532db24d49714 commit d3b0843d2cec1650e837c421e39532db24d49714 Author: Cy Schubert AuthorDate: 2025-10-22 15:59:26 +0000 Commit: Cy Schubert CommitDate: 2025-10-26 03:14:08 +0000 ipfilter: Plug ip_nat kernel information leak ipf_nat_getent() allocates a variable-sized nat_save_t buffer with KMALLOCS() (which does not zero memory) and then copies only a subset of fields into it before returning the object to userland using ipf_outobjsz(). Because the structure is not fully initialized on all paths, uninitialized kernel heap bytes can be copied back to user space, resulting in an information leak. We fix this by zeroing out the data structure immediately after allocation. Reported by: Ilja Van Sprundel Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D53274 (cherry picked from commit 6535e9308a26e17023831fe68fb71d2febf2a002) --- sys/netpfil/ipfilter/netinet/ip_nat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c index 972511f43bd5..53c180cdfbca 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -1771,6 +1771,7 @@ ipf_nat_getent(ipf_main_softc_t *softc, caddr_t data, int getlock) IPFERROR(60029); return (ENOMEM); } + bzero(ipn, ipns.ipn_dsize); if (getlock) { READ_ENTER(&softc->ipf_nat);