From patchwork Mon Mar 3 18:54:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 325994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 0E5A02C00CA for ; Tue, 4 Mar 2014 05:57:22 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1WKY3C-00082O-5b; Mon, 03 Mar 2014 18:57:18 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1WKY2A-0007UH-7K for kernel-team@lists.ubuntu.com; Mon, 03 Mar 2014 18:56:14 +0000 Received: from c-67-160-228-185.hsd1.ca.comcast.net ([67.160.228.185] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1WKY28-0003CR-TF; Mon, 03 Mar 2014 18:56:13 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1WKY27-0007Wt-3G; Mon, 03 Mar 2014 10:56:11 -0800 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Subject: [PATCH 3.8 07/67] [media] mxl111sf: Fix unintentional garbage stack read Date: Mon, 3 Mar 2014 10:54:55 -0800 Message-Id: <1393872955-28810-8-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393872955-28810-1-git-send-email-kamal@canonical.com> References: <1393872955-28810-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.8 Cc: Dave Jones , Kamal Mostafa , Mauro Carvalho Chehab X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 3.8.13.19 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Dave Jones commit 866e8d8a9dc1ebb4f9e67197e264ac2df81f7d4b upstream. mxl111sf_read_reg takes an address of a variable to write to as an argument. drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c:mxl111sf_config_pin_mux_modes passes several uninitialized stack variables to this routine, expecting them to be filled in. In the event that something unexpected happens when reading from the chip, we end up doing a pr_debug of the value passed in, revealing whatever garbage happened to be on the stack. Change the pr_debug to match what happens in the 'success' case, where we assign buf[1] to *data. Spotted with Coverity (Bugs 731910 through 731917) Signed-off-by: Dave Jones Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab [ kamal: backport to 3.8 (context) ] Signed-off-by: Kamal Mostafa --- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c index efdcb15..a26cd01 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c @@ -103,7 +103,7 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data) ret = -EINVAL; } - deb_reg("R: (0x%02x, 0x%02x)\n", addr, *data); + deb_reg("R: (0x%02x, 0x%02x)\n", addr, buf[1]); fail: return ret; }