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 DB55E1C6FF0 for ; Wed, 26 Feb 2025 01:59:01 +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=1740535141; cv=none; b=cyfN4n1JU2JFG8TTkzClUUuWtXOpFM3u8d0SI+8jhXBY+9Qc7UJwr17JGGEgbLNXONgFawwfnoVCjMHtIb5DXc+Qbblm8pRTv3igxSV5jmV6meUNIL6DYi8kNVk02A3CzKrOBUEzcJLfFf4aqFzSkd2woXa74Wb3OW1idj06zrk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535141; c=relaxed/simple; bh=MRbPEIA6AbMkPM90hZyUzb9zkZ/wf3TFsRgOEVkLU3A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nBnheszBXkDUQvmoEidaofY22r1Iwlvpl7QASVnjKc0BUBTjjMo305i+HhvcG4aJgqtMC8DoaCsguJ/1i0fUer8BSVSrmROWkYxGruVmAG0M3zws0aNMy7sR3yyW0FpLx0gn2un4wbLiZ4Jr2fi009RcWq5zTXy7QYA0GfxZx6k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Xy0fyQ9Q; 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="Xy0fyQ9Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE846C4CEDD; Wed, 26 Feb 2025 01:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535141; bh=MRbPEIA6AbMkPM90hZyUzb9zkZ/wf3TFsRgOEVkLU3A=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Xy0fyQ9QM6N9NMJhu8FP8a4pwQ52lQVs6MfmGydW6J50Bc7Ffg/0mgC8XkyQ3AoVj 1OheV1lJoqwH9i9ATfwFx3ZYVtXWMKMxIkO50rSj2H+UKbp+tFeIqdOaRKOl4YFd71 h2dCaPtjILk7gnRi2+KQ3aD6jVS3N7HLEQWmIl1k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49168: btrfs: do not clean up repair bio if submit fails Date: Wed, 26 Feb 2025 02:56:13 +0100 Message-ID: <2025022612-CVE-2022-49168-d59d@gregkh> X-Mailer: git-send-email 2.48.1 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=2191; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=MRbPEIA6AbMkPM90hZyUzb9zkZ/wf3TFsRgOEVkLU3A=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7SlyOh+q9zXuycmOLYaIm+zr3U+sKuGOmVr4w/2Qfd UfZWaukI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACaidIxhfsqFrDv7b/G7z9iX oP5pj8yn15UWtxgWbJ2187hY/ob2My+fXLuwbAuD8pmaZAA= 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: do not clean up repair bio if submit fails The submit helper will always run bio_endio() on the bio if it fails to submit, so cleaning up the bio just leads to a variety of use-after-free and NULL pointer dereference bugs because we race with the endio function that is cleaning up the bio. Instead just return BLK_STS_OK as the repair function has to continue to process the rest of the pages, and the endio for the repair bio will do the appropriate cleanup for the page that it was given. The Linux kernel CVE team has assigned CVE-2022-49168 to this issue. Affected and fixed versions =========================== Fixed in 5.16.19 with commit e76c78c48902dae6fa612749f59162bca0a79e0b Fixed in 5.17.2 with commit d1cb11fb45ebbb1e7dfe5e9038b32ea72c184b14 Fixed in 5.18 with commit 8cbc3001a3264d998d6b6db3e23f935c158abd4d 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-49168 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_io.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/e76c78c48902dae6fa612749f59162bca0a79e0b https://git.kernel.org/stable/c/d1cb11fb45ebbb1e7dfe5e9038b32ea72c184b14 https://git.kernel.org/stable/c/8cbc3001a3264d998d6b6db3e23f935c158abd4d