From patchwork Thu May 22 18:43:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 4229191 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BB2059F1CD for ; Fri, 23 May 2014 08:43:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DEEA820383 for ; Fri, 23 May 2014 08:43:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9C506201EC for ; Fri, 23 May 2014 08:43:23 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BD10B2656FB; Fri, 23 May 2014 10:43:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AF4752655E3; Fri, 23 May 2014 10:42:44 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6C09926568B; Thu, 22 May 2014 20:44:08 +0200 (CEST) Received: from smtp.outflux.net (smtp.outflux.net [198.145.64.163]) by alsa0.perex.cz (Postfix) with ESMTP id 0157E264FE3 for ; Thu, 22 May 2014 20:43:59 +0200 (CEST) Received: from www.outflux.net (serenity.outflux.net [10.2.0.2]) by vinyl.outflux.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id s4MIhtrv027922; Thu, 22 May 2014 11:43:56 -0700 Date: Thu, 22 May 2014 11:43:55 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Message-ID: <20140522184355.GA8301@www.outflux.net> MIME-Version: 1.0 Content-Disposition: inline X-MIMEDefang-Filter: outflux$Revision: 1.316 $ X-HELO: www.outflux.net X-Scanned-By: MIMEDefang 2.73 X-Mailman-Approved-At: Fri, 23 May 2014 10:42:42 +0200 Cc: Wenkai Du , alsa-devel@alsa-project.org, Christian Engelmayer , Takashi Iwai , Liam Girdwood , Mark Brown , Jarkko Nikula , Dan Carpenter Subject: [alsa-devel] [PATCH] ASoC: Intel: avoid format string leak to thread name X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This makes sure a format string can never get processed into the worker thread name from the device name. Signed-off-by: Kees Cook --- sound/soc/intel/sst-baytrail-ipc.c | 2 +- sound/soc/intel/sst-haswell-ipc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/sst-baytrail-ipc.c b/sound/soc/intel/sst-baytrail-ipc.c index 0d31dbbf4806..1b25bf168beb 100644 --- a/sound/soc/intel/sst-baytrail-ipc.c +++ b/sound/soc/intel/sst-baytrail-ipc.c @@ -809,7 +809,7 @@ int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata) /* start the IPC message thread */ init_kthread_worker(&byt->kworker); byt->tx_thread = kthread_run(kthread_worker_fn, - &byt->kworker, + &byt->kworker, "%s", dev_name(byt->dev)); if (IS_ERR(byt->tx_thread)) { err = PTR_ERR(byt->tx_thread); diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index e7996b39a484..a8fd60c67341 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c @@ -1735,7 +1735,7 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata) /* start the IPC message thread */ init_kthread_worker(&hsw->kworker); hsw->tx_thread = kthread_run(kthread_worker_fn, - &hsw->kworker, + &hsw->kworker, "%s", dev_name(hsw->dev)); if (IS_ERR(hsw->tx_thread)) { ret = PTR_ERR(hsw->tx_thread);