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 4F3DF3D8912; Wed, 8 Apr 2026 18:56:42 +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=1775674603; cv=none; b=jiT0MIrPEVTxWOYTarj5acGroOZ6D7G/HYk90lPJikxyaMUCWI8/osKfL4xpVftA/KrPFuvpMvfvnP8jX3rlz/9SbvttMlzlRV4BuFW5zKEOQ7B6dHlfsn14VrcOj31x2DxTkU6ZhYxhfodr6MPKKGX1k5JwytwrmgNUxlLp5ss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775674603; c=relaxed/simple; bh=y4YwnDr4zNY/qW0b4ErusYbeNP6vQuY2e/At+lrLLTw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zjnk5xGbRXDIPHW2phfBJOVSVaZFn3KcRGUKYtWvX4jGsLzjz7JXcYnOljTz8CIid6trMHm/w4BTEH79B4Zmkz37GoBA/nNYN9K/chi5K4gSIu5+InTWUgDyC1W+BoELJeQwai/wIQx9iLctQ1YCYE3Sl3kdgkzfmYokLD6Un/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LrISRsuQ; 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="LrISRsuQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73655C19421; Wed, 8 Apr 2026 18:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775674602; bh=y4YwnDr4zNY/qW0b4ErusYbeNP6vQuY2e/At+lrLLTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LrISRsuQ/dnZNSEeaTo8xRoK7IM3ev0uaop5q/TiUi82wSQ4EsBQUNLReZT03rF1t lB0b58N+PJ0NQ6IMjg5HJ67NUK3zx527ivBxcMIEOpih1C2dE8RMZyK0loCJU0DExI q4hJRgkDf3W4vTxM7pvfh7sMaXvUaT+WlKpDMfcA= 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 6.19 161/311] drm/ioc32: stop speculation on the drm_compat_ioctl path Date: Wed, 8 Apr 2026 20:02:41 +0200 Message-ID: <20260408175945.415491746@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175939.393281918@linuxfoundation.org> References: <20260408175939.393281918@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-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 @@ -374,6 +375,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);