All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jani Nikula" <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 11/11] drm/i915/dsi: add bounds checks to mipi_exec_spi()
Date: Wed, 02 Dec 2026 15:05:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-246047@kernel.org> (raw)
In-Reply-To: <d25b3271a089cc83bae51ba9c3337e53020c3d4c.1796223381.git.jani.nikula@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dsi: data[5] read before bounds check in
  mipi_exec_spi()
--

commit ec35016de2189ce711a37c74efe2dacb73e72ce9
Author: Jani Nikula <jani.nikula@intel.com>

drm/i915/dsi: add bounds checks to mipi_exec_spi()

This commit adds bounds checks on the passed-in buffer size in
mipi_exec_spi() before skipping the SPI element.

> diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
> index 6b4896119db6e..90e5ab8f5fd5e 100644
> --- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
> +++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
> @@ -562,6 +562,14 @@ static int mipi_exec_spi(struct intel_dsi *intel_dsi, const u8 *data, int size)
>  	struct intel_display *display = to_intel_display(&intel_dsi->base);
>  	int payload_size = data[5];
>  
> +	if (size && size < 6)
> +		return -EINVAL;
> +
> +	payload_size = data[5];

[Severity: Medium]
Does initializing payload_size to data[5] at its declaration still read
data[5] before the size < 6 check?  A truncated SPI element at the end of
the VBT sequence buffer with 0 < size < 6 will still read out of bounds.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1796223381.git.jani.nikula@intel.com?part=11

  reply	other threads:[~2026-12-02 15:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 14:58 [PATCH 00/11] drm/i915/dsi: improve VBT sequence block parsing Jani Nikula
2026-12-02 14:58 ` [PATCH 01/11] drm/i915/dsi: don't modify data pointer in mipi_exec_send_packet() Jani Nikula
2026-12-02 14:58 ` [PATCH 02/11] drm/i915/dsi: use payload_size name in mipi_exec_gpio() Jani Nikula
2026-12-02 14:58 ` [PATCH 03/11] drm/i915/dsi: return parsed length from mipi_exec_* Jani Nikula
2026-12-02 14:58 ` [PATCH 04/11] drm/i915/dsi: focus on the happy day scenario path, handle errors first Jani Nikula
2026-12-02 14:58 ` [PATCH 05/11] drm/i915/dsi: add error handling to element execution Jani Nikula
2026-12-02 15:10   ` sashiko-bot
2026-12-02 15:14   ` [PATCH v2] " Jani Nikula
2026-12-02 14:58 ` [PATCH 06/11] drm/i915/dsi: pass operation size to exec hooks Jani Nikula
2026-12-02 14:58 ` [PATCH 07/11] drm/i915/dsi: add bounds checks to mipi_exec_send_packet() Jani Nikula
2026-12-02 14:58 ` [PATCH 08/11] drm/i915/dsi: add bounds checks to mipi_exec_delay() Jani Nikula
2026-12-02 14:58 ` [PATCH 09/11] drm/i915/dsi: add bounds checks to mipi_exec_gpio() Jani Nikula
2026-12-02 14:58 ` [PATCH 10/11] drm/i915/dsi: add bounds checks to mipi_exec_i2c() Jani Nikula
2026-12-02 14:58 ` [PATCH 11/11] drm/i915/dsi: add bounds checks to mipi_exec_spi() Jani Nikula
2026-12-02 15:05   ` sashiko-bot [this message]
2026-12-02 15:15   ` [PATCH v2] " Jani Nikula
2026-12-02 15:47 ` ✓ CI.KUnit: success for drm/i915/dsi: improve VBT sequence block parsing (rev3) Patchwork

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=sashiko-outbox-246047@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 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.