mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: chentao <chentao@kylinos.cn>,
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com, airlied@gmail.com, daniel@ffwll.ch,
	andi.shyti@linux.intel.com, robdclark@chromium.org,
	jonathan.cavitt@intel.com, andrzej.hajda@intel.com,
	chris.p.wilson@intel.com, alan.previn.teres.alexis@intel.com
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, kunwu.chan@hotmail.com
Subject: Re: [PATCH] drm/i915: Fix potential spectre vulnerability
Date: Thu, 2 Nov 2023 11:32:43 +0000	[thread overview]
Message-ID: <d300506c-ab82-4cc1-b750-61e54ec2ad9e@linux.intel.com> (raw)
In-Reply-To: <20231102101642.52988-1-chentao@kylinos.cn>


On 02/11/2023 10:16, chentao wrote:
> 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>

I don't know if this is actually exploitable given the time deltas between the index is read from userspace and acted upon here, which is at least two ioctls apart. But I suppose no harm in fixing and for safety so we need to add:

Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)")
Cc: <stable@vger.kernel.org> # v5.15+

> ---
>   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;
> -

Just please refrain from random whitespace modifications like this blank line removal. If you resend without that you can add my r-b.

Regards,

Tvrtko

> +		idx = array_index_nospec(idx, pc->num_user_engines);
>   		pe = &pc->user_engines[idx];
>   
>   		/* Only render engine supports RPCS configuration. */

  reply	other threads:[~2023-11-02 11:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 10:16 chentao
2023-11-02 11:32 ` Tvrtko Ursulin [this message]
2023-11-03  0:07   ` Andi Shyti
2023-11-03  2:31   ` Kunwu Chan
2023-11-03  2:32   ` [PATCH v2] " Kunwu Chan
2023-11-03  6:56     ` Krzysztof Kozlowski
2023-11-03  8:23       ` Tvrtko Ursulin
2023-11-06  9:57     ` Andi Shyti
2023-11-06 10:15       ` Tvrtko Ursulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d300506c-ab82-4cc1-b750-61e54ec2ad9e@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=alan.previn.teres.alexis@intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=chentao@kylinos.cn \
    --cc=chris.p.wilson@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jonathan.cavitt@intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kunwu.chan@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@chromium.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®