From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9282C606A69C for ; Wed, 2 Dec 2026 15:05:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Z+QATNX0 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 59D6410E56F; Wed, 2 Dec 2026 15:05:08 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0EF8610EA74; Wed, 2 Dec 2026 15:05:02 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id A53514128A; Wed, 2 Dec 2026 15:05:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23D1B1F000C1; Wed, 2 Dec 2026 15:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796223901; bh=lg4HxqY50MSi4ymZPcT1ob4PLXZXrFa6YF1SXBodnoE=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=Z+QATNX0O4FuEOGULj4pgCCuzb9LWippJ8jHDJx/kPCTiVB+XQavIWf49G/idEitD 1OAupkW9plgQ5sA/WwEMyzLDzwxYV17oxM7raJ7a1kZWiN1coUybv/kg0xKok5dr7R CMOSTEeh80HMlxdFjKuhZuoahfrlBhZyuAV7B6vY8eXjcoFYfe3+GmhcEHiBZUv18/ STwO8IaXL9mHtFk30RfnnBGE9lFmEE/L+By9vy9wJcBMvZWMrFzXY27fxQQLHRFw04 NAGqkGFE1qStlEuYxajqhPpvSaaQZNWx5tvV+TsFi/BkmxdbMWxDp+7Ph6fMnWohnB EPiU47Bg4py1A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 11/11] drm/i915/dsi: add bounds checks to mipi_exec_spi() To: "Jani Nikula" , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 15:05:00 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: 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 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/d= rm/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 =3D to_intel_display(&intel_dsi->base); > int payload_size =3D data[5]; > =20 > + if (size && size < 6) > + return -EINVAL; > + > + payload_size =3D 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796223381.gi= t.jani.nikula@intel.com?part=3D11