diff mbox

drm: i915: Avoid format string expansion from engine names

Message ID 20170411045630.GA6612@beast (mailing list archive)
State New, archived
Headers show

Commit Message

Kees Cook April 11, 2017, 4:56 a.m. UTC
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(-)

Comments

Jani Nikula April 19, 2017, 12:51 p.m. UTC | #1
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
diff mbox

Patch

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);
 }
 
 /*