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 51501E567 for ; Thu, 1 May 2025 14:17:35 +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=1746109055; cv=none; b=I+ZOjAc3n+MJ3FdJwjRKPbTS3OqejvRQfR+a0i1seO0hqoL5S7FIFxL+GrO+UGnGRfE2Sj4IXU5lDdKzP54gwLfWVVezD+ozLb1noysmQbhMO0irHBhMkwgLUAIACbvBWO1rzhGrx6WWN7CIRpyM27Vp0nQeD1DOORv48Z8NS9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746109055; c=relaxed/simple; bh=h3waMcCqq+wE40XGdSHd+rxryUkyw1kL0GcrULCuMMk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DkygfksJjm40H09kthI3pXu0OQ6lzDsuuK/Pb9twaw8RFoLVuDaNYQAeeOKvtsBGdxTVSFBw1hA+HFFmX7RsisKTHXfzfJgi6OVpb+9Qs3dld5dL9UnRyiyRwJlMdeNsRQuMybvqkaP3MiOw5EX9nk1oASK0g4k+KPewBalvgrE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CR7hj8ne; 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="CR7hj8ne" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8DC3C4CEE3; Thu, 1 May 2025 14:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746109055; bh=h3waMcCqq+wE40XGdSHd+rxryUkyw1kL0GcrULCuMMk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CR7hj8neRWSnA0zyoQefoQULoLNk7meaLonU3bB/FhrlkHwck1tcDV5xgvJs/gFuA 0Yzlsce9BWisBBhHFItXIzApaBeePOoNyoM1EWG9iUnMSb/+Mdf+G48uXflI6ZjohS 6xVhB8sZ3hO2EwH122zQwev3eAAn3xHSHknrQK04= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49895: cxl/region: Fix decoder allocation crash Date: Thu, 1 May 2025 16:11:25 +0200 Message-ID: <2025050159-CVE-2022-49895-50fa@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=2425; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=C9iRYtqPeSIL9zIRZOduo59rBcvtYQO7MMStmTq/6/I=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDdu3vJx4TXFXmMu+7EjhFRv4zBdO8V/Kvvs+Z7//T KXrAtP3dMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEKvkYFrS09sd/ZJVKZMxQ fHo8eefWijOnHBkWrD36Op5NK4uPcX1OQXtoeUlXV74MAA== 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: cxl/region: Fix decoder allocation crash When an intermediate port's decoders have been exhausted by existing regions, and creating a new region with the port in question in it's hierarchical path is attempted, cxl_port_attach_region() fails to find a port decoder (as would be expected), and drops into the failure / cleanup path. However, during cleanup of the region reference, a sanity check attempts to dereference the decoder, which in the above case didn't exist. This causes a NULL pointer dereference BUG. To fix this, refactor the decoder allocation and de-allocation into helper routines, and in this 'free' routine, check that the decoder, @cxld, is valid before attempting any operations on it. The Linux kernel CVE team has assigned CVE-2022-49895 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit 384e624bb211b406db40edc900bb51af8bb267d0 and fixed in 6.0.8 with commit c6813b5610ac53af73edd87a660d23a0511faa47 Issue introduced in 6.0 with commit 384e624bb211b406db40edc900bb51af8bb267d0 and fixed in 6.1 with commit 71ee71d7adcba648077997a29a91158d20c40b09 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-49895 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: drivers/cxl/core/region.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/c6813b5610ac53af73edd87a660d23a0511faa47 https://git.kernel.org/stable/c/71ee71d7adcba648077997a29a91158d20c40b09