From mboxrd@z Thu Jan 1 00:00:00 1970 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 E306B30DEB5; Mon, 13 Apr 2026 16:38:30 +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=1776098311; cv=none; b=S16M4lf34tfUc1e6SNADq3/ArBqL4viFmQ41MaLPRNwiMh0BrcRBeXJ8YLPis89/gkLIgkV0i9+T336nEd6de/0ECb0APCRapzLvHO6hARAK4c6dox/tSbG87Z0EWIBi6WAOuv4C7n4RnrSPL3yrBChdfm1u35XB51bcpLp8sEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098311; c=relaxed/simple; bh=4NZ9K7BeQhUTNEoiCj8nojtg7gsHLBbS/Q0+NiujwQ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KOuQWroZrNEAB78S0TTRTW+yJy259oMIz8kD/t63iYoazKG/Dwh7fFKxF3oXZFc+m+efhUS+jPGL0HADiNszeXQNAc1faRoMDz8ZEoKtXADJBq0ffHmy6EE3go+wy4Kb5AQAPmrYxAU5aiQHbkKiAfKZfHt7+VxBg6dSLACkC2E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DbzqdpeL; 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="DbzqdpeL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AA02C2BCAF; Mon, 13 Apr 2026 16:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776098310; bh=4NZ9K7BeQhUTNEoiCj8nojtg7gsHLBbS/Q0+NiujwQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DbzqdpeLlB4VoowRd1DFR0OPOb9iSmeC2WmwWAOm7URGJFFFiNZHYqQ+4sYwMgMuq Y74dH1k8WQDnmv2OUrNbMaf0k+sRJnmZrIYQ8OYAd4AxxIxBf2UF6HYAsjlu8gH5qR kZbhiyum7Wl1z4lIgLZ9O3LGc6gFbmS0xWBpAQA8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , stable Subject: [PATCH 5.15 443/570] drm/ioc32: stop speculation on the drm_compat_ioctl path Date: Mon, 13 Apr 2026 17:59:34 +0200 Message-ID: <20260413155847.066119422@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kroah-Hartman commit f8995c2df519f382525ca4bc90553ad2ec611067 upstream. The drm compat ioctl path takes a user controlled pointer, and then dereferences it into a table of function pointers, the signature method of spectre problems. Fix this up by calling array_index_nospec() on the index to the function pointer list. Fixes: 505b5240329b ("drm/ioctl: Fix Spectre v1 vulnerabilities") Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Simona Vetter Cc: stable Assisted-by: gkh_clanker_2000 Signed-off-by: Greg Kroah-Hartman Acked-by: Thomas Zimmermann Acked-by: Maxime Ripard Reviewed-by: Simona Vetter Signed-off-by: Thomas Zimmermann Link: https://patch.msgid.link/2026032451-playing-rummage-8fa2@gregkh Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_ioc32.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -28,6 +28,7 @@ * IN THE SOFTWARE. */ #include +#include #include #include @@ -982,6 +983,7 @@ long drm_compat_ioctl(struct file *filp, if (nr >= ARRAY_SIZE(drm_compat_ioctls)) return drm_ioctl(filp, cmd, arg); + nr = array_index_nospec(nr, ARRAY_SIZE(drm_compat_ioctls)); fn = drm_compat_ioctls[nr].fn; if (!fn) return drm_ioctl(filp, cmd, arg);