public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: i915: Avoid format string expansion from engine names
@ 2017-04-11  4:56 Kees Cook
  2017-04-19 12:51 ` Jani Nikula
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2017-04-11  4:56 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mika Kuoppala, Daniel Vetter, Jani Nikula, David Airlie,
	intel-gfx, dri-devel

While highly unlikely, this makes sure that the string built from
engine names won't be processed as a format string.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/gpu/drm/i915/intel_hangcheck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_hangcheck.c b/drivers/gpu/drm/i915/intel_hangcheck.c
index f05971f5586f..be3550cec8e4 100644
--- a/drivers/gpu/drm/i915/intel_hangcheck.c
+++ b/drivers/gpu/drm/i915/intel_hangcheck.c
@@ -407,7 +407,7 @@ static void hangcheck_declare_hang(struct drm_i915_private *i915,
 				 "%s, ", engine->name);
 	msg[len-2] = '\0';
 
-	return i915_handle_error(i915, hung, msg);
+	return i915_handle_error(i915, hung, "%s", msg);
 }
 
 /*
-- 
2.7.4


-- 
Kees Cook
Pixel Security

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

* Re: [PATCH] drm: i915: Avoid format string expansion from engine names
  2017-04-11  4:56 [PATCH] drm: i915: Avoid format string expansion from engine names Kees Cook
@ 2017-04-19 12:51 ` Jani Nikula
  0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2017-04-19 12:51 UTC (permalink / raw)
  To: Kees Cook, linux-kernel
  Cc: Mika Kuoppala, Daniel Vetter, David Airlie, intel-gfx, dri-devel

On Tue, 11 Apr 2017, Kees Cook <keescook@chromium.org> wrote:
> While highly unlikely, this makes sure that the string built from
> engine names won't be processed as a format string.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>

Pushed to drm-intel-next-queued, thanks for the patch.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/intel_hangcheck.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hangcheck.c b/drivers/gpu/drm/i915/intel_hangcheck.c
> index f05971f5586f..be3550cec8e4 100644
> --- a/drivers/gpu/drm/i915/intel_hangcheck.c
> +++ b/drivers/gpu/drm/i915/intel_hangcheck.c
> @@ -407,7 +407,7 @@ static void hangcheck_declare_hang(struct drm_i915_private *i915,
>  				 "%s, ", engine->name);
>  	msg[len-2] = '\0';
>  
> -	return i915_handle_error(i915, hung, msg);
> +	return i915_handle_error(i915, hung, "%s", msg);
>  }
>  
>  /*
> -- 
> 2.7.4

-- 
Jani Nikula, Intel Open Source Technology Center

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

end of thread, other threads:[~2017-04-19 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-11  4:56 [PATCH] drm: i915: Avoid format string expansion from engine names Kees Cook
2017-04-19 12:51 ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox