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 9F2A5218ADC for ; Thu, 27 Mar 2025 14:59:38 +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=1743087578; cv=none; b=KGY+a1B18kLISGad5+Z2OVLMdUefYJkQMt2lf/zMVmhcvunmUfb3ui6Y2B5CEG1eeATENhx4dQEpTecBn7jkoEgLmM4mK0oC2pbao7i98uv7tBwFkh8ER49TguVmcnv96lqxXPXUlAWkNvTtkOR6AqDYB1S/SVRNbktpV4Gdt4I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743087578; c=relaxed/simple; bh=2apZWNF5LY5mNHJJkyu9dxGAJLT0t2s59yxG9PJKthw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=u8dSiyq3CvvXtmy6sRGTFoHMZheT7e55vP4X4myxK9jr4HxBV7TyYJreBi1Ai/A0ZuFLRf/p02c5SVRyn9GcP5sAgt3dOWsT9PDHCQ16vDnHdK8tefALbZSeJFGIm88UoPdtKW2No4J15WWQiw8sLTGFYfnM7a32sIdmKDeQUlE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=s0SuB9kS; 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="s0SuB9kS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02FF6C4CEDD; Thu, 27 Mar 2025 14:59:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743087578; bh=2apZWNF5LY5mNHJJkyu9dxGAJLT0t2s59yxG9PJKthw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=s0SuB9kSqF6c1SbzP+ZxLJ/jBS6ZMtPpXDVc7Lw6/3yUMO9hdQ9y/1n/Tzk6SosN9 pfTg3rGQs1C/ycbQrJOKurwVhXc56Sf1Oo6h4cbxNA7dRDMQ1uP1Dbt6qBcYld4RaA YlGIAUjav85KapXXcwC9tZjH+ecQEusvOwNy9G9g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21879: btrfs: fix use-after-free on inode when scanning root during em shrinking Date: Thu, 27 Mar 2025 15:58:13 +0100 Message-ID: <2025032711-CVE-2025-21879-f338@gregkh> X-Mailer: git-send-email 2.49.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=2206; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2apZWNF5LY5mNHJJkyu9dxGAJLT0t2s59yxG9PJKthw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlP05tnzpRi9BbPsWe+c1cvbKdGQUnhNNanlvlR1yd63 pK0VdXviGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIkYxTMsOCXJ3iy9YVPDVHfj E+03FubeeXv6AMOCQ4v4DzV1rQ6I/OW5f1NppM3zS7/KAQ== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: btrfs: fix use-after-free on inode when scanning root during em shrinking At btrfs_scan_root() we are accessing the inode's root (and fs_info) in a call to btrfs_fs_closing() after we have scheduled the inode for a delayed iput, and that can result in a use-after-free on the inode in case the cleaner kthread does the iput before we dereference the inode in the call to btrfs_fs_closing(). Fix this by using the fs_info stored already in a local variable instead of doing inode->root->fs_info. The Linux kernel CVE team has assigned CVE-2025-21879 to this issue. Affected and fixed versions =========================== Issue introduced in 6.13 with commit 1020443840569535f6025a855958f07ea3eebf71 and fixed in 6.13.6 with commit 5e79d26014f9386387575b9ed60d342057cee49b Issue introduced in 6.13 with commit 1020443840569535f6025a855958f07ea3eebf71 and fixed in 6.14 with commit 59f37036bb7ab3d554c24abc856aabca01126414 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-21879 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/btrfs/extent_map.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/5e79d26014f9386387575b9ed60d342057cee49b https://git.kernel.org/stable/c/59f37036bb7ab3d554c24abc856aabca01126414