diff mbox

[2/8] drm/i915/dsi: don't pass arbitrary data to sideband

Message ID ebe3c2eee623afc4b3a134533b01f8d591d13f32.1454582914.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula Feb. 4, 2016, 10:50 a.m. UTC
Since sequence block v2 the second byte contains flags other than just
pull up/down. Don't pass arbitrary data to the sideband interface.

The rest may or may not work for sequence block v2, but there should be
no harm done.

Cc: stable@vger.kernel.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ville Syrjala Feb. 4, 2016, 3:41 p.m. UTC | #1
On Thu, Feb 04, 2016 at 12:50:50PM +0200, Jani Nikula wrote:
> Since sequence block v2 the second byte contains flags other than just
> pull up/down. Don't pass arbitrary data to the sideband interface.
> 
> The rest may or may not work for sequence block v2, but there should be
> no harm done.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

well, as far as it can be reviewed with the crappy specs.

> ---
>  drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> index 4775aa5462e8..6f013efba45b 100644
> --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> @@ -207,7 +207,7 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>  	gpio = *data++;
>  
>  	/* pull up/down */
> -	action = *data++;
> +	action = *data++ & 1;
>  
>  	if (gpio >= ARRAY_SIZE(gtable)) {
>  		DRM_DEBUG_KMS("unknown gpio %u\n", gpio);
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula Feb. 4, 2016, 4:56 p.m. UTC | #2
On Thu, 04 Feb 2016, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Feb 04, 2016 at 12:50:50PM +0200, Jani Nikula wrote:
>> Since sequence block v2 the second byte contains flags other than just
>> pull up/down. Don't pass arbitrary data to the sideband interface.
>> 
>> The rest may or may not work for sequence block v2, but there should be
>> no harm done.
>> 
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> well, as far as it can be reviewed with the crappy specs.

Pushed patches 1-2 to dinq, thanks for the review.

BR,
Jani.

>
>> ---
>>  drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> index 4775aa5462e8..6f013efba45b 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> @@ -207,7 +207,7 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>>  	gpio = *data++;
>>  
>>  	/* pull up/down */
>> -	action = *data++;
>> +	action = *data++ & 1;
>>  
>>  	if (gpio >= ARRAY_SIZE(gtable)) {
>>  		DRM_DEBUG_KMS("unknown gpio %u\n", gpio);
>> -- 
>> 2.1.4
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 4775aa5462e8..6f013efba45b 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -207,7 +207,7 @@  static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
 	gpio = *data++;
 
 	/* pull up/down */
-	action = *data++;
+	action = *data++ & 1;
 
 	if (gpio >= ARRAY_SIZE(gtable)) {
 		DRM_DEBUG_KMS("unknown gpio %u\n", gpio);