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 C852E29CA for ; Wed, 22 May 2024 06:19:52 +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=1716358792; cv=none; b=BbYmJCuPuKRVflgyCWgiDphCPPxAMeKBLflAgB1VQDgGuIW3kZXfFF23o38zetWlHEOJM8VNzFhN83FH7pmTr2sk7V77iAq6xzK1btasCmeTpYNqtAV8eqDom4Gt8jA794m7CIxDwOX+U4X3qRDJBHLt0ZwOuAe02Y+gKTQBAJw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716358792; c=relaxed/simple; bh=p4P54tB4Y5TylhqDeV9L4O+F2CewdqJ8/VReoErhwIM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NZOntqT5t8G8yiSIV5oRVLF8DODOC2gWkEjehU2JP0ytCrUnU97E3eA8+bJLJCTlSZHqEZGEjdRl42x6AgwUsK4bqEptArOCnCHwF8trOHRDXzoTG05hQJFQhA1I7Up03gzvp+dtkq6+iv0opX73IClLvoXcTnqFDaZGgJntbmY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PDctRoYr; 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="PDctRoYr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4874C2BD11; Wed, 22 May 2024 06:19:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716358792; bh=p4P54tB4Y5TylhqDeV9L4O+F2CewdqJ8/VReoErhwIM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=PDctRoYrEK1jortasWlkhsoDZ+aGredmel8mymjO1rGhWOOxfkdW2PMGRSdibTTQw AaNfDCdwU6GWe/eTBzeeuO5Jge2Hwgo4Hg/Rl9iVNDahi3O21KGiBdiXlFjfdSvbOE nKpH5tgLXl+koYrav3kLLw0dKA0k+cg3wreyqWMo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47433: btrfs: fix abort logic in btrfs_replace_file_extents Date: Wed, 22 May 2024 08:19:36 +0200 Message-ID: <2024052235-CVE-2021-47433-659b@gregkh> X-Mailer: git-send-email 2.45.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=2179; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=p4P54tB4Y5TylhqDeV9L4O+F2CewdqJ8/VReoErhwIM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm+feWKC3K4rn27LMDU7r64xfRIVkuj1YnitAQpkSnzC 27PncPSEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPZLcEw33OjlUdU443lkQen b9S0n3Fp5aQ8SYZ5yrJaFjYqn3/Nn/3UN2yvAHPvF+FfAA== 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 abort logic in btrfs_replace_file_extents Error injection testing uncovered a case where we'd end up with a corrupt file system with a missing extent in the middle of a file. This occurs because the if statement to decide if we should abort is wrong. The only way we would abort in this case is if we got a ret != -EOPNOTSUPP and we called from the file clone code. However the prealloc code uses this path too. Instead we need to abort if there is an error, and the only error we _don't_ abort on is -EOPNOTSUPP and only if we came from the clone file code. The Linux kernel CVE team has assigned CVE-2021-47433 to this issue. Affected and fixed versions =========================== Fixed in 5.10.75 with commit 0e32a2b85c7d Fixed in 5.14.14 with commit 0e309e1152fc Fixed in 5.15 with commit 4afb912f439c 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-2021-47433 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/file.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/0e32a2b85c7d92ece86c17dfef390c5ed79c6378 https://git.kernel.org/stable/c/0e309e1152fc34ef75991d9d69b165dbf75bf26c https://git.kernel.org/stable/c/4afb912f439c4bc4e6a4f3e7547f2e69e354108f