[{"id":1763634,"web_url":"http://patchwork.ozlabs.org/comment/1763634/","msgid":"<20170905221654.64f2aae5@wiggum>","list_archive_url":null,"date":"2017-09-05T20:18:22","subject":"Re: [PATCH 1/2] b43: fix unitialized reads of ret by initializing\n\tthe array to zero","submitter":{"id":7938,"url":"http://patchwork.ozlabs.org/api/people/7938/","name":"Michael Büsch","email":"m@bues.ch"},"content":"On Tue,  5 Sep 2017 19:15:50 +0100\nColin King <colin.king@canonical.com> wrote:\n\n> From: Colin Ian King <colin.king@canonical.com>\n> \n> The u8 char array ret is not being initialized and elements outside\n> the range start to end contain just garbage values from the stack.\n> This results in a later scan of the array to read potentially\n> uninitialized values.  Fix this by initializing the array to zero.\n> This seems to have been an issue since the very first commit.\n> \n> Detected by CoverityScan CID#139652 (\"Uninitialized scalar variable\")\n> \n> Signed-off-by: Colin Ian King <colin.king@canonical.com>\n> ---\n>  drivers/net/wireless/broadcom/b43/phy_g.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/drivers/net/wireless/broadcom/b43/phy_g.c b/drivers/net/wireless/broadcom/b43/phy_g.c\n> index 822dcaa8ace6..f59c02166462 100644\n> --- a/drivers/net/wireless/broadcom/b43/phy_g.c\n> +++ b/drivers/net/wireless/broadcom/b43/phy_g.c\n> @@ -2297,7 +2297,7 @@ static u8 b43_gphy_aci_detect(struct b43_wldev *dev, u8 channel)\n>  static u8 b43_gphy_aci_scan(struct b43_wldev *dev)\n>  {\n>  \tstruct b43_phy *phy = &dev->phy;\n> -\tu8 ret[13];\n> +\tu8 ret[13] = { 0 };\n>  \tunsigned int channel = phy->channel;\n>  \tunsigned int i, j, start, end;\n>  \n\n\nThis fix seems to be correct.\nThanks for finding and fixing the issue.\n\nReviewed-by: Michael Buesch <m@bues.ch>","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmzQd31m7z9sCZ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  6 Sep 2017 06:51:21 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753110AbdIEUus (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 5 Sep 2017 16:50:48 -0400","from bues.ch ([80.190.117.144]:48856 \"EHLO bues.ch\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752753AbdIEUuq (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tTue, 5 Sep 2017 16:50:46 -0400","by bues.ch with esmtpsa (Exim 4.84_2) (envelope-from <m@bues.ch>)\n\tid 1dpKJT-0002NK-Hb; Tue, 05 Sep 2017 22:19:11 +0200"],"X-Greylist":"delayed 1889 seconds by postgrey-1.27 at vger.kernel.org;\n\tTue, 05 Sep 2017 16:50:45 EDT","Date":"Tue, 5 Sep 2017 22:18:22 +0200","From":"Michael =?utf-8?b?QsO8c2No?= <m@bues.ch>","To":"Colin King <colin.king@canonical.com>","Cc":"Kalle Valo <kvalo@codeaurora.org>, linux-wireless@vger.kernel.org,\n\tb43-dev@lists.infradead.org, netdev@vger.kernel.org,\n\tkernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org","Subject":"Re: [PATCH 1/2] b43: fix unitialized reads of ret by initializing\n\tthe array to zero","Message-ID":"<20170905221654.64f2aae5@wiggum>","In-Reply-To":"<20170905181550.23839-1-colin.king@canonical.com>","References":"<20170905181550.23839-1-colin.king@canonical.com>","X-Mailer":"Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tboundary=\"Sig_/80wMKUt39IjFt4bU2T+R9fe\";\n\tprotocol=\"application/pgp-signature\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1771803,"web_url":"http://patchwork.ozlabs.org/comment/1771803/","msgid":"<20170920124124.7B32460725@smtp.codeaurora.org>","list_archive_url":null,"date":"2017-09-20T12:41:24","subject":"Re: [1/2] b43: fix unitialized reads of ret by initializing the\n\tarray to zero","submitter":{"id":65411,"url":"http://patchwork.ozlabs.org/api/people/65411/","name":"Kalle Valo","email":"kvalo@codeaurora.org"},"content":"Colin Ian King <colin.king@canonical.com> wrote:\n\n> From: Colin Ian King <colin.king@canonical.com>\n> \n> The u8 char array ret is not being initialized and elements outside\n> the range start to end contain just garbage values from the stack.\n> This results in a later scan of the array to read potentially\n> uninitialized values.  Fix this by initializing the array to zero.\n> This seems to have been an issue since the very first commit.\n> \n> Detected by CoverityScan CID#139652 (\"Uninitialized scalar variable\")\n> \n> Signed-off-by: Colin Ian King <colin.king@canonical.com>\n> Reviewed-by: Michael Buesch <m@bues.ch>\n\n2 patches applied to wireless-drivers-next.git, thanks.\n\ne31fbe1034d9 b43: fix unitialized reads of ret by initializing the array to zero\ne3ae1c772046 b43legacy: fix unitialized reads of ret by initializing the array to zero","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=codeaurora.org header.i=@codeaurora.org\n\theader.b=\"gpZXk8ch\"; \n\tdkim=pass (1024-bit key) header.d=codeaurora.org\n\theader.i=@codeaurora.org header.b=\"SKB7T/fQ\"; \n\tdkim-atps=neutral","pdx-caf-mail.web.codeaurora.org;\n\tdmarc=none (p=none dis=none)\n\theader.from=codeaurora.org","pdx-caf-mail.web.codeaurora.org;\n\tspf=none smtp.mailfrom=kvalo@codeaurora.org"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xxzrd66WJz9s82\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 20 Sep 2017 22:41:37 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751966AbdITMl0 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 08:41:26 -0400","from smtp.codeaurora.org ([198.145.29.96]:48556 \"EHLO\n\tsmtp.codeaurora.org\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751663AbdITMlZ (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 20 Sep 2017 08:41:25 -0400","by smtp.codeaurora.org (Postfix, from userid 1000)\n\tid 7B32460725; Wed, 20 Sep 2017 12:41:24 +0000 (UTC)","from potku.adurom.net (a88-114-240-52.elisa-laajakaista.fi\n\t[88.114.240.52])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\t(Authenticated sender: kvalo@smtp.codeaurora.org)\n\tby smtp.codeaurora.org (Postfix) with ESMTPSA id DE43160134;\n\tWed, 20 Sep 2017 12:41:20 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org;\n\ts=default; t=1505911284;\n\tbh=eS6YjfFyBD6WjnmrIGNTKdhm5sWxBkkqDgbbdmDrC+Q=;\n\th=Subject:From:In-Reply-To:References:To:Cc:Date:From;\n\tb=gpZXk8chZ/JShK7y1ee3l4tmbIEDL1pScc9GHVxkPnobuOT1LIcEJ4qMgubpkLjdm\n\tQeW3EhtYdT3VyD+QWfZOl1FuZbZjYpLeX+I8OpHVA/vQpCFtaEzublwaMLx3XqdXu6\n\tGnGOkHstMGq04l3fkdQtNC3gLDTJ6n7IP5+0Xx7o=","v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org;\n\ts=default; t=1505911282;\n\tbh=eS6YjfFyBD6WjnmrIGNTKdhm5sWxBkkqDgbbdmDrC+Q=;\n\th=Subject:From:In-Reply-To:References:To:Cc:From;\n\tb=SKB7T/fQE9L8xsgjYjpkHUxl0b+91i9YKUAZt5USPmUDfaBR4NG92D2AWvk06f86y\n\t5+FI46IsuLlYoyR5yVHx4nC63dDI8k9D02DvyL67y7ZN6Yb+tG/E7CbXY8N/nEZQSi\n\tLxFPHSNqPKYZlQG8W93rCFZXqxBZfFENW6x9WCx0="],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tpdx-caf-mail.web.codeaurora.org","X-Spam-Level":"","X-Spam-Status":"No, score=-0.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,\n\tDKIM_SIGNED,MISSING_DATE,MISSING_MID,T_DKIM_INVALID autolearn=no\n\tautolearn_force=no version=3.4.0","DMARC-Filter":"OpenDMARC Filter v1.3.2 smtp.codeaurora.org DE43160134","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"7bit","Subject":"Re: [1/2] b43: fix unitialized reads of ret by initializing the\n\tarray to zero","From":"Kalle Valo <kvalo@codeaurora.org>","In-Reply-To":"<20170905181550.23839-1-colin.king@canonical.com>","References":"<20170905181550.23839-1-colin.king@canonical.com>","To":"Colin Ian King <colin.king@canonical.com>","Cc":"linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org,\n\tnetdev@vger.kernel.org, kernel-janitors@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org","User-Agent":"pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12","Message-Id":"<20170920124124.7B32460725@smtp.codeaurora.org>","Date":"Wed, 20 Sep 2017 12:41:24 +0000 (UTC)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]