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 B6CEC217F33 for ; Thu, 27 Mar 2025 16:44:38 +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=1743093878; cv=none; b=eAeOuSeHZhMT5kn9m+l4wbs66KrKGLSA2rzNu3r2/lgz+ao3ZXmrrXWhFD/t+mtX3L19nSUL2UCnP6sFx52F3IM7nxo4vCCYhtxcy9i9ovzoGRc0sbB5ABfc9OI4BgjwBmBimK3uoffLY3j6316lyJJ6AMBzJ+uSA4uZzmbNzTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743093878; c=relaxed/simple; bh=IBJ2YPvxceRJOgNYuhLR8RXSGXbPdq5ld0be7sV+8Qk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FYdLTo6TPR1aCKs150R+AUBZafaoyicf8wBL7Z5s9JTbG+TviYgZFqlS8H1nJMZIOWuOEMGJXctsO2QRpDShoJgq/SfxYXjV9FQxo796mv9gmdgXurqDp5vhBE4DW+6FTw18C/JmYgCGvbUBOR5aM4oQQ2/K2BKiqKmhdhbYGqc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=V3TpfTNG; 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="V3TpfTNG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25B95C4CEEA; Thu, 27 Mar 2025 16:44:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743093878; bh=IBJ2YPvxceRJOgNYuhLR8RXSGXbPdq5ld0be7sV+8Qk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=V3TpfTNGavqlwet37yZQcoqDqGbuBMzz6OJCe43GdJAgRRMEQwlKkIiWOWWOeFSK+ G1hVS86r3BGd+PIBNhl6I/4fw6eakU8zJ355D5v4rMjiG6A9NdTVKv5bTp7yeUpFYJ jrSwrV3+f2Fg/hiRsKpF4B/lCbRdag1kp89MLPEE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52981: drm/i915: Fix request ref counting during error capture & debugfs dump Date: Thu, 27 Mar 2025 17:43:28 +0100 Message-ID: <2025032706-CVE-2023-52981-070c@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=3620; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=IBJ2YPvxceRJOgNYuhLR8RXSGXbPdq5ld0be7sV+8Qk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlPG6R4tr54le3wsZRhndEijdK8DinWxPP8z28qhdzRE bOyesXfEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABNptWeYny7L+sah3tjkK3f7 queH9N+fDbPNYFhw8kxRz7XIautD53ZUFXOnvvnlajYRAA== 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: drm/i915: Fix request ref counting during error capture & debugfs dump When GuC support was added to error capture, the reference counting around the request object was broken. Fix it up. The context based search manages the spinlocking around the search internally. So it needs to grab the reference count internally as well. The execlist only request based search relies on external locking, so it needs an external reference count but within the spinlock not outside it. The only other caller of the context based search is the code for dumping engine state to debugfs. That code wasn't previously getting an explicit reference at all as it does everything while holding the execlist specific spinlock. So, that needs updaing as well as that spinlock doesn't help when using GuC submission. Rather than trying to conditionally get/put depending on submission model, just change it to always do the get/put. v2: Explicitly document adding an extra blank line in some dense code (Andy Shevchenko). Fix multiple potential null pointer derefs in case of no request found (some spotted by Tvrtko, but there was more!). Also fix a leaked request in case of !started and another in __guc_reset_context now that intel_context_find_active_request is actually reference counting the returned request. v3: Add a _get suffix to intel_context_find_active_request now that it grabs a reference (Daniele). v4: Split the intel_guc_find_hung_context change to a separate patch and rename intel_context_find_active_request_get to intel_context_get_active_request (Tvrtko). v5: s/locking/reference counting/ in commit message (Tvrtko) (cherry picked from commit 3700e353781e27f1bc7222f51f2cc36cbeb9b4ec) The Linux kernel CVE team has assigned CVE-2023-52981 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15 with commit 573ba126aef37c8315e5bb68d2dad515efa96994 and fixed in 6.1.11 with commit 9467397f417dd7b5d0db91452f0474e79716a527 Issue introduced in 5.15 with commit 573ba126aef37c8315e5bb68d2dad515efa96994 and fixed in 6.2 with commit 86d8ddc74124c3fdfc139f246ba6da15e45e86e3 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-2023-52981 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_context.c drivers/gpu/drm/i915/gt/intel_context.h drivers/gpu/drm/i915/gt/intel_engine_cs.c drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c drivers/gpu/drm/i915/i915_gpu_error.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/9467397f417dd7b5d0db91452f0474e79716a527 https://git.kernel.org/stable/c/86d8ddc74124c3fdfc139f246ba6da15e45e86e3