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 B4792333725 for ; Wed, 24 Dec 2025 13:07:40 +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=1766581660; cv=none; b=atlZHV9wb12r4dkti4dHsriFyNsxohxIW1pS5YhGQXoYzbK74gb9K8GO+aIWRlpboh0kgPuRa95wGDTKDd0i+Eg0I9VMxolw+RjSjYsueNcrvlmZwCszuL6OlWrphjgxm3OB4IThIgJiPnakB3VjTcaY8PWzi3oEwltoMFg4jZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766581660; c=relaxed/simple; bh=Bnd5CWz4zDiEHQQEJXkVrtwXsazIRS/BgXSNXhCUtx4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hB+Ve1uvtyJWwjuLVzsHnCkQw4m0kkv2N4MhMGZPXFSeKMp+6F+MT/aiNo4pYOJRJAMJ9PhZ+uIrF7IEmXn6uAfkG8Wz8Vs6hc+YBUlja4rqNzzLR3ibxC2eXNucOWVX9SbJ9OBel+ZPN2clqq0G7x6pGnbBCG7XzmxgZORagRE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TrbQupkD; 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="TrbQupkD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECA1BC4CEFB; Wed, 24 Dec 2025 13:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766581660; bh=Bnd5CWz4zDiEHQQEJXkVrtwXsazIRS/BgXSNXhCUtx4=; h=From:To:Cc:Subject:Date:Reply-To:From; b=TrbQupkDtVlvElsyo5bOO83z3teS8SFNF6k1TAi1ZSU0+KaMOrJNRXcrQ9jMEgqQ1 3X90KgHvTsf1NNEvcRVqLg+5qHL3TX0e6pgP/ALcYjhiGsQkJcyzbyL7t1DhgOSx+G z0qRxakxFpXiC/YAgfjb/AD80TdKdH9jf/WwaEKU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50766: btrfs: set generation before calling btrfs_clean_tree_block in btrfs_init_new_buffer Date: Wed, 24 Dec 2025 14:06:17 +0100 Message-ID: <2025122456-CVE-2022-50766-0964@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2890; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hPgeioYyum6B2qfQOYRvi4ocYemJS56uvda6TOq4PVU=; b=owGbwMvMwCRo6H6F97bub03G02pJDJneT007twtrBZ3/M2WZ0emQlKMT/qz/o7Z2fUXPlafdD Yny3LcvdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE/F8wzE/94Z2gft/93qes W1/cLTKNbJtX6jMs2DifW/Z25dfnojY1+1ubhVenSIUfBwA= 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: btrfs: set generation before calling btrfs_clean_tree_block in btrfs_init_new_buffer syzbot is reporting uninit-value in btrfs_clean_tree_block() [1], for commit bc877d285ca3dba2 ("btrfs: Deduplicate extent_buffer init code") missed that btrfs_set_header_generation() in btrfs_init_new_buffer() must not be moved to after clean_tree_block() because clean_tree_block() is calling btrfs_header_generation() since commit 55c69072d6bd5be1 ("Btrfs: Fix extent_buffer usage when nodesize != leafsize"). Since memzero_extent_buffer() will reset "struct btrfs_header" part, we can't move btrfs_set_header_generation() to before memzero_extent_buffer(). Just re-add btrfs_set_header_generation() before btrfs_clean_tree_block(). The Linux kernel CVE team has assigned CVE-2022-50766 to this issue. Affected and fixed versions =========================== Issue introduced in 4.19 with commit bc877d285ca3dba24c52406946a4a69847cc7422 and fixed in 5.15.75 with commit 0a408c6212c16b9a2a1141d3c531247582ef8101 Issue introduced in 4.19 with commit bc877d285ca3dba24c52406946a4a69847cc7422 and fixed in 5.19.17 with commit a687c2890fe4a2acaac6941fa4097a1264d8f3eb Issue introduced in 4.19 with commit bc877d285ca3dba24c52406946a4a69847cc7422 and fixed in 6.0.3 with commit 89bc41c92d10b905c60f6ec13c9ef664a3555c54 Issue introduced in 4.19 with commit bc877d285ca3dba24c52406946a4a69847cc7422 and fixed in 6.1 with commit cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38 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-2022-50766 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-tree.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/0a408c6212c16b9a2a1141d3c531247582ef8101 https://git.kernel.org/stable/c/a687c2890fe4a2acaac6941fa4097a1264d8f3eb https://git.kernel.org/stable/c/89bc41c92d10b905c60f6ec13c9ef664a3555c54 https://git.kernel.org/stable/c/cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38