Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6971B26FA60 for ; Thu, 4 Sep 2025 15:34:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757000074; cv=none; b=LPzenGFDLIkd0L7agPDDC3QkOOvaW5lo57VN74ZCFRDTcRyUh9cvdXlWuI9gPmBMswqElHVe4YZ8KmUikf6kzLHppHw+v1NK3CjGSXz1QvMOyJNDhUg7FpM2OBRREve8nYn0GeTDymNk/AKjwHKgljcgpuO+Owz0RkDfJmTIFTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757000074; c=relaxed/simple; bh=iUtbkU1hApS9LzlGVxiC5YQyLaVc+oKJi8iMpLV/C4o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=k3uXBt+7byHtNrpDPC/eszHZbUnyz/rLvqWw7wf3RVQQmEMhFV4+YJS03tzQpvEb9i7EN+CNssqSHD1zpPuc/4gNcVksyoKRBd0vbHwDwCXICh/6Dr25bGtJnaPv4B5NcLdzWPIr9CA1Tp3PXMyV2DCIxQW/Roaoi6Xsvz1Xsu8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Py730W8c; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Py730W8c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7657C4CEF0; Thu, 4 Sep 2025 15:34:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757000074; bh=iUtbkU1hApS9LzlGVxiC5YQyLaVc+oKJi8iMpLV/C4o=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Py730W8cjnSkSqws5IjMAMMCVPL4z+WCICx3Sksk82Wq5CHWUvcKJE6IfmrkbeCSv R1Yb5ir8wSc/VXq3NaqiL9k1CYeTerHeszr2Kp4TXBlVRrfvmXZbEwl8l1HoPRnB0+ a78RwSYP5/bnEQzOU/dXMnuU+ZJPXkRWllNQbZI8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38710: gfs2: Validate i_depth for exhash directories Date: Thu, 4 Sep 2025 17:33:15 +0200 Message-ID: <2025090456-CVE-2025-38710-1b60@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2627; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Qykzrg2MLyb2RPIwMmOhuLG0VKgDtFjd0JghfSrWh8Y=; b=owGbwMvMwCRo6H6F97bub03G02pJDBk7N2oc6PmdqNOyo2oWp0//C5fTxtfWTlPfWfFKu8VqZ o/VrPtPOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi3jwM88MYZtc6R4nfepwR /X9dv1D3BSGnPQzzM+fHx7QuKLeutts4tez5otp7fhPzAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: gfs2: Validate i_depth for exhash directories A fuzzer test introduced corruption that ends up with a depth of 0 in dir_e_read(), causing an undefined shift by 32 at: index = hash >> (32 - dip->i_depth); As calculated in an open-coded way in dir_make_exhash(), the minimum depth for an exhash directory is ilog2(sdp->sd_hash_ptrs) and 0 is invalid as sdp->sd_hash_ptrs is fixed as sdp->bsize / 16 at mount time. So we can avoid the undefined behaviour by checking for depth values lower than the minimum in gfs2_dinode_in(). Values greater than the maximum are already being checked for there. Also switch the calculation in dir_make_exhash() to use ilog2() to clarify how the depth is calculated. Tested with the syzkaller repro.c and xfstests '-g quick'. The Linux kernel CVE team has assigned CVE-2025-38710 to this issue. Affected and fixed versions =========================== Fixed in 6.12.43 with commit 53a0249d68a210c16e961b83adfa82f94ee0a53d Fixed in 6.15.11 with commit b5f46951e62377b6e406fadc18bc3c5bdf1632a7 Fixed in 6.16.2 with commit 9680c58675b82348ab84d387e4fa727f7587e1a0 Fixed in 6.17-rc1 with commit 557c024ca7250bb65ae60f16c02074106c2f197b Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-38710 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/gfs2/dir.c fs/gfs2/glops.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/53a0249d68a210c16e961b83adfa82f94ee0a53d https://git.kernel.org/stable/c/b5f46951e62377b6e406fadc18bc3c5bdf1632a7 https://git.kernel.org/stable/c/9680c58675b82348ab84d387e4fa727f7587e1a0 https://git.kernel.org/stable/c/557c024ca7250bb65ae60f16c02074106c2f197b