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 617EB13EFE3 for ; Wed, 1 Oct 2025 08:07:44 +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=1759306064; cv=none; b=DRzUhP4UuggXEmHeGmjmq1nI2mZeP+kpJ9GTFP2ayKG1l+Ev7yS/OsNRwj0EWpq8Wo/6sI+mfWszToTXL4JHSHf8oTSvHmjRiNTDi4pHiGr4S1dhB0zLjGuUWIn3BXEFe1OdrQ3siPWemtrP5e4UpKMRkbSU5mBNhSG93T53lD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759306064; c=relaxed/simple; bh=DGAzVE0m2WZPBxwjHk49qBOoFkrXiIUlh3gifgeQDAc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=U6w+XFXa0C8Ii9ZjkxDLSQziUCRLxq0oZ73QD++7uXdPixWU1wnDGi/21JSbBx7brjYUgC67ntJaLgS5k9Yhz0Sp2fi+s2EG4jlVs+h1u8GZJ1+hgx82YkiPUKIH4otgNVcAVzbpekj3uqWs+8Qe9TyRVvw320M9l5nNeVHT8YU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kUA+AHf4; 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="kUA+AHf4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85837C4CEF4; Wed, 1 Oct 2025 08:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759306064; bh=DGAzVE0m2WZPBxwjHk49qBOoFkrXiIUlh3gifgeQDAc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=kUA+AHf4+nq47SiGUXY46JDCI/OXqfAP2ndT6pXPJw02BdQmNwkTnouwuTKP2DGgU oSD52m3f1Y7hWDPz5tV1xrIpcpk4oyB+1GMk1nraV2a+WlGhl5PPScmgQvILijUa28 QgtSXks7nDcrtWL8Q3wIOfs+imdsWjZ6wnUUf+Bs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39927: ceph: fix race condition validating r_parent before applying state Date: Wed, 1 Oct 2025 10:07:27 +0200 Message-ID: <2025100125-CVE-2025-39927-5a57@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=3196; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=/hJOpXMkKTH7AB/dJEXsz+xMv4sbvcQP1X0yh8IzXd4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl3Htoui3p2NTm1d40f71Ob+jt70q4f0dn5IX1arXAvL 7OKiV58RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExk1yKG+bEbzNbJuCi22idM 0l/7wOT5xqnr5zHM4fv23bXmY1DqE/EPyzZYPdVcz7rJGgA= 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: ceph: fix race condition validating r_parent before applying state Add validation to ensure the cached parent directory inode matches the directory info in MDS replies. This prevents client-side race conditions where concurrent operations (e.g. rename) cause r_parent to become stale between request initiation and reply processing, which could lead to applying state changes to incorrect directory inodes. [ idryomov: folded a kerneldoc fixup and a follow-up fix from Alex to move CEPH_CAP_PIN reference when r_parent is updated: When the parent directory lock is not held, req->r_parent can become stale and is updated to point to the correct inode. However, the associated CEPH_CAP_PIN reference was not being adjusted. The CEPH_CAP_PIN is a reference on an inode that is tracked for accounting purposes. Moving this pin is important to keep the accounting balanced. When the pin was not moved from the old parent to the new one, it created two problems: The reference on the old, stale parent was never released, causing a reference leak. A reference for the new parent was never acquired, creating the risk of a reference underflow later in ceph_mdsc_release_request(). This patch corrects the logic by releasing the pin from the old parent and acquiring it for the new parent when r_parent is switched. This ensures reference accounting stays balanced. ] The Linux kernel CVE team has assigned CVE-2025-39927 to this issue. Affected and fixed versions =========================== Fixed in 6.12.48 with commit db378e6f83ec705c6091c65d482d555edc2b0a72 Fixed in 6.16.8 with commit 2bfe45987eb346e299d9f763f9cd05f77011519f Fixed in 6.17 with commit 15f519e9f883b316d86e2bb6b767a023aafd9d83 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-39927 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/ceph/debugfs.c fs/ceph/dir.c fs/ceph/file.c fs/ceph/inode.c fs/ceph/mds_client.c fs/ceph/mds_client.h 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/db378e6f83ec705c6091c65d482d555edc2b0a72 https://git.kernel.org/stable/c/2bfe45987eb346e299d9f763f9cd05f77011519f https://git.kernel.org/stable/c/15f519e9f883b316d86e2bb6b767a023aafd9d83