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 6132C219E8 for ; Wed, 18 Jun 2025 11:04:47 +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=1750244687; cv=none; b=NvoXFrFSHb+4AGh/GYZxza9ONlzXS52HzuT9FQZJTHVq+V9g4pZgVVbsA8uOg9M0kBazgkwTwod/c3rVKFLjGZMn0LM1cKZsqPcxDmfj7h3B6HC+IopPGUW5FpPwjfsFaq6h4TZditGaU6vevsX292vBoB9qlSekkkAx5s/ExQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244687; c=relaxed/simple; bh=LzG/anzn02/ccq2t6OFOE0r6VfXptEJCrZO6jWFzoEs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SmRJlqKH2bxEyDT+hKDB99KdjPTO1YCf1fzg1NuLSaUZD3qI1D9touWMuBa7IwVHdJd9mT73n5SqxKy1IptAPQ6w1u1/E1lQVk5yan1DSwCk1i648BqWrWUtzyZZmQXM4MBRuhDZ4NsqqoZTCKrO+sw9ZxJ6ZM4Oig3xT4werNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JMW/GTHt; 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="JMW/GTHt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D354C4CEED; Wed, 18 Jun 2025 11:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244686; bh=LzG/anzn02/ccq2t6OFOE0r6VfXptEJCrZO6jWFzoEs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=JMW/GTHtECg9uu2g5TEKO0R4vIX5t92Dxzf59sWuQwOqIjBfYaI/vbWW8Ed4a9bhc IZgGzLIbL3354yt/0oX/Tikmii7Oeyaf78FDEEbUCB9JSG4/j8RjdGF+g0kWLQWV1+ eIw5mgDJxHbpPoXtvqaZp3psTD9/Tq5WBPfeJvms= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49963: drm/i915/ttm: fix CCS handling Date: Wed, 18 Jun 2025 13:00:28 +0200 Message-ID: <2025061814-CVE-2022-49963-1a09@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=2788; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=V1mViX4MsJfBkmyBkD2M7DylCBckAYeT79Pl4MBgaqc=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc+z8gjZ7qZ99I7C+3eiFxoZHhabre7c0liR/+Hlm4 SpjPxbujlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIxEKGBa033nYFZEp6fJxg GNX+3fGcf/KtKQxzpRb1FryM2cKVfc5y2cTPxjMtjyeXAgA= 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: drm/i915/ttm: fix CCS handling Crucible + recent Mesa seems to sometimes hit: GEM_BUG_ON(num_ccs_blks > NUM_CCS_BLKS_PER_XFER) And it looks like we can also trigger this with gem_lmem_swapping, if we modify the test to use slightly larger object sizes. Looking closer it looks like we have the following issues in migrate_copy(): - We are using plain integer in various places, which we can easily overflow with a large object. - We pass the entire object size (when the src is lmem) into emit_pte() and then try to copy it, which doesn't work, since we only have a few fixed sized windows in which to map the pages and perform the copy. With an object > 8M we therefore aren't properly copying the pages. And then with an object > 64M we trigger the GEM_BUG_ON(num_ccs_blks > NUM_CCS_BLKS_PER_XFER). So it looks like our copy handling for any object > 8M (which is our CHUNK_SZ) is currently broken on DG2. Testcase: igt@gem_lmem_swapping (cherry picked from commit 8676145eb2f53a9940ff70910caf0125bd8a4bc2) The Linux kernel CVE team has assigned CVE-2022-49963 to this issue. Affected and fixed versions =========================== Issue introduced in 5.19 with commit da0595ae91da837929a00470ab40546090e5b9ae and fixed in 5.19.8 with commit 97434cb55bd884bd268626ec41489f79b261b2d4 Issue introduced in 5.19 with commit da0595ae91da837929a00470ab40546090e5b9ae and fixed in 6.0 with commit 8d905254162965c8e6be697d82c7dbf5d08f574d 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-49963 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/gpu/drm/i915/gt/intel_migrate.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/97434cb55bd884bd268626ec41489f79b261b2d4 https://git.kernel.org/stable/c/8d905254162965c8e6be697d82c7dbf5d08f574d