From patchwork Tue Apr 11 04:56:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9674555 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1AE6360231 for ; Tue, 11 Apr 2017 04:56:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11A8B2839B for ; Tue, 11 Apr 2017 04:56:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04DDE284DC; Tue, 11 Apr 2017 04:56:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 849A42839B for ; Tue, 11 Apr 2017 04:56:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BCEB6E13B; Tue, 11 Apr 2017 04:56:33 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x232.google.com (mail-pg0-x232.google.com [IPv6:2607:f8b0:400e:c05::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0FA896E13B for ; Tue, 11 Apr 2017 04:56:32 +0000 (UTC) Received: by mail-pg0-x232.google.com with SMTP id g2so114948549pge.3 for ; Mon, 10 Apr 2017 21:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=M2Trsg0IMOc97VMvd7PVZZXnYArNA1iogJyhUZMclDY=; b=c4D4HXpoycjXyDfH2QkVH7m7qbcanpBshYylPno6c31SI8A/kq0hvJ34fCLPHvb0Ti R7Qt2ExdJ1jZi+nTE8Ynj6Jxr3L0LhHyuHUnibVkoYQeCJk+vmJzO29d1MXQcU1/1jQY 49uWs/XOWvYlgvmrj4/wtbnQydWOk6KJ2SZLM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=M2Trsg0IMOc97VMvd7PVZZXnYArNA1iogJyhUZMclDY=; b=iK2brg3Cl/Ik6EQs5MSmUm/ETC/fAre4IIggoy86lVsXZ6IrMf1xG9a73QOzr8Wa6r vzLzUarscnKujVLo99XQ+nNd/epL1yAyAtJkUjplRHV5kgJYd9LXQHBGjcmRo/s5iodU SFneh9xwcNWvIL0xqpsQeJarO4mFRNvYTOgiQrleX6mcu4Q2BY1FNk8bg0wOWyrAmFkd zaaX/IgdYvlJKLr8pFQ9mUCgP7l4KpQ4iSEcUIq2JI7+1433nH19LGAM0TQflb9K3CsS DLCFebMFRyf2ClPwqkNiWTdHqBLwdnEoiLcsCnvRw8Zq7k7DVJo2/jlvYz7P51MTLvM4 IV5A== X-Gm-Message-State: AFeK/H3ZU75cpjP2Wcg/gghCoLOpOPkzk7rNgUlEcisUx5BynaiQ5xWBasfFSOTMAo3btLVj X-Received: by 10.84.232.131 with SMTP id i3mr72487474plk.172.1491886591736; Mon, 10 Apr 2017 21:56:31 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id r7sm2798672pgn.26.2017.04.10.21.56.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 21:56:30 -0700 (PDT) Date: Mon, 10 Apr 2017 21:56:30 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Message-ID: <20170411045630.GA6612@beast> MIME-Version: 1.0 Content-Disposition: inline Cc: David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Daniel Vetter Subject: [Intel-gfx] [PATCH] drm: i915: Avoid format string expansion from engine names X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); } /*