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 5BF9D2E613A for ; Wed, 12 Nov 2025 22:01:02 +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=1762984862; cv=none; b=Dkzh1sRQlpjUxgb2zpS2EqsONYGAblogQpZx8M/wH5DaW2vCdCkMxV857YkFJ/VEGvy9ltnAypRzX6X4G6b9JoXLLzpNUpeLrpcDEYpMndS1FH0FolnuTc0SbN6IQ9ZXxiVwpCtDQtLoqp7LiEvSMyI3eks2rVZ7eRbgz2JABy8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762984862; c=relaxed/simple; bh=z+pDt+G8y9hWSb5ALz4sijrH/d+Lh9tNoXZpkdPrP7Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kaBo+4C3YAGOpl/W+vcmXOUkf5pxFufYAFTWm7SPvJoFmew4pRc/iqZGmHbdniF2PXw/8e4qzYrjpBCgDWRSvmfHJ5EjHFGy7ibZ4EKiZSrqrSvKF7Na0G+0IP+pyAzZCAlZYo7kfyeimQA4t5KK1FGEc8sFaMwwWTCWD2ENsoY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dAoywoBQ; 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="dAoywoBQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D628AC4CEF7; Wed, 12 Nov 2025 22:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762984862; bh=z+pDt+G8y9hWSb5ALz4sijrH/d+Lh9tNoXZpkdPrP7Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=dAoywoBQHoFj/gGoN7xKBszz5OzPRIVJWXxBHi9I0RhGXMhG2RVW2C5kHieZlhZbe B5iTTz+HEgTnQxJxrqvC0DIcmojPyJxRA2oiayVFqW2f7IVR5wTdOwUxIoP6w6sFPy 8ZW8WUBjEDgVUjfK/EDuP+vbQraCqmR2vpggQLB4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40190: ext4: guard against EA inode refcount underflow in xattr update Date: Wed, 12 Nov 2025 17:00:53 -0500 Message-ID: <2025111244-CVE-2025-40190-b6bc@gregkh> X-Mailer: git-send-email 2.51.2 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=3240; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=pOd8NvwVzqx4+Abf2r3egnN11q8twP8Ygb6iGU14XqQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmizD027O3LMvTOXTvrpV6qwb39xNRZsc3ffNbxeeo4b RRMOHK+I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZSY8Gw4KCUUy/XEt8HD978 14i95sc2Z+aV0wwLZjhFHIu8cVT88zVu573f3xc4no63BAA= 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: ext4: guard against EA inode refcount underflow in xattr update syzkaller found a path where ext4_xattr_inode_update_ref() reads an EA inode refcount that is already <= 0 and then applies ref_change (often -1). That lets the refcount underflow and we proceed with a bogus value, triggering errors like: EXT4-fs error: EA inode ref underflow: ref_count=-1 ref_change=-1 EXT4-fs warning: ea_inode dec ref err=-117 Make the invariant explicit: if the current refcount is non-positive, treat this as on-disk corruption, emit ext4_error_inode(), and fail the operation with -EFSCORRUPTED instead of updating the refcount. Delete the WARN_ONCE() as negative refcounts are now impossible; keep error reporting in ext4_error_inode(). This prevents the underflow and the follow-on orphan/cleanup churn. The Linux kernel CVE team has assigned CVE-2025-40190 to this issue. Affected and fixed versions =========================== Fixed in 5.4.301 with commit ea39e712c2f5ae148ee5515798ae03523673e002 Fixed in 5.10.246 with commit 1cfb3e4ddbdc8e02e637b8852540bd4718bf4814 Fixed in 5.15.195 with commit 505e69f76ac497e788f4ea0267826ec7266b40c8 Fixed in 6.1.157 with commit 3d6269028246f4484bfed403c947a114bb583631 Fixed in 6.6.113 with commit 79ea7f3e11effe1bd9e753172981d9029133a278 Fixed in 6.12.54 with commit 6b879c4c6bbaab03c0ad2a983953bd1410bb165e Fixed in 6.17.4 with commit 440b003f449a4ff2a00b08c8eab9ba5cd28f3943 Fixed in 6.18-rc1 with commit 57295e835408d8d425bef58da5253465db3d6888 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-40190 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/ext4/xattr.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/ea39e712c2f5ae148ee5515798ae03523673e002 https://git.kernel.org/stable/c/1cfb3e4ddbdc8e02e637b8852540bd4718bf4814 https://git.kernel.org/stable/c/505e69f76ac497e788f4ea0267826ec7266b40c8 https://git.kernel.org/stable/c/3d6269028246f4484bfed403c947a114bb583631 https://git.kernel.org/stable/c/79ea7f3e11effe1bd9e753172981d9029133a278 https://git.kernel.org/stable/c/6b879c4c6bbaab03c0ad2a983953bd1410bb165e https://git.kernel.org/stable/c/440b003f449a4ff2a00b08c8eab9ba5cd28f3943 https://git.kernel.org/stable/c/57295e835408d8d425bef58da5253465db3d6888