All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915: Fix potential spectre vulnerability
@ 2023-11-02 10:16 ` chentao
  0 siblings, 0 replies; 30+ messages in thread
From: chentao @ 2023-11-02 10:16 UTC (permalink / raw)
  To: jani.nikula, joonas.lahtinen, rodrigo.vivi, tvrtko.ursulin,
	airlied, daniel, andi.shyti, robdclark, jonathan.cavitt,
	andrzej.hajda, chris.p.wilson, alan.previn.teres.alexis
  Cc: chentao, intel-gfx, linux-kernel, dri-devel, kunwu.chan

Fix smatch warning:
drivers/gpu/drm/i915/gem/i915_gem_context.c:847 set_proto_ctx_sseu()
warn: potential spectre issue 'pc->user_engines' [r] (local cap)

Signed-off-by: chentao <chentao@kylinos.cn>
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index 9a9ff84c90d7..b2fdfc7ca4de 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -843,7 +843,7 @@ static int set_proto_ctx_sseu(struct drm_i915_file_private *fpriv,
 
 		if (idx >= pc->num_user_engines)
 			return -EINVAL;
-
+		idx = array_index_nospec(idx, pc->num_user_engines);
 		pe = &pc->user_engines[idx];
 
 		/* Only render engine supports RPCS configuration. */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2023-11-07  6:56 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-02 10:16 [Intel-gfx] [PATCH] drm/i915: Fix potential spectre vulnerability chentao
2023-11-02 10:16 ` chentao
2023-11-02 10:16 ` chentao
2023-11-02 11:32 ` [Intel-gfx] " Tvrtko Ursulin
2023-11-02 11:32   ` Tvrtko Ursulin
2023-11-02 11:32   ` Tvrtko Ursulin
2023-11-03  0:07   ` [Intel-gfx] " Andi Shyti
2023-11-03  0:07     ` Andi Shyti
2023-11-03  0:07     ` Andi Shyti
2023-11-03  2:31   ` [Intel-gfx] " Kunwu Chan
2023-11-03  2:31     ` Kunwu Chan
2023-11-03  2:31     ` Kunwu Chan
2023-11-03  2:32   ` [Intel-gfx] [PATCH v2] " Kunwu Chan
2023-11-03  2:32     ` Kunwu Chan
2023-11-03  2:32     ` Kunwu Chan
2023-11-03  6:56     ` [Intel-gfx] " Krzysztof Kozlowski
2023-11-03  6:56       ` Krzysztof Kozlowski
2023-11-03  6:56       ` Krzysztof Kozlowski
2023-11-03  8:23       ` [Intel-gfx] " Tvrtko Ursulin
2023-11-03  8:23         ` Tvrtko Ursulin
2023-11-03  8:23         ` Tvrtko Ursulin
2023-11-06  9:57     ` [Intel-gfx] " Andi Shyti
2023-11-06  9:57       ` Andi Shyti
2023-11-06  9:57       ` Andi Shyti
2023-11-06 10:15       ` [Intel-gfx] " Tvrtko Ursulin
2023-11-06 10:15         ` Tvrtko Ursulin
2023-11-06 10:15         ` Tvrtko Ursulin
2023-11-06 21:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Fix potential spectre vulnerability (rev2) Patchwork
2023-11-06 22:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-11-07  6:56 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.