[{"id":1763633,"web_url":"http://patchwork.ozlabs.org/comment/1763633/","msgid":"<20170905221705.3a5c4ffa@wiggum>","list_archive_url":null,"date":"2017-09-05T20:18:28","subject":"Re: [PATCH 2/2] b43legacy: fix unitialized reads of ret by\n\tinitializing the 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:16:58 +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#139653 (\"Uninitialized scalar variable\")\n> \n> Signed-off-by: Colin Ian King <colin.king@canonical.com>\n> ---\n>  drivers/net/wireless/broadcom/b43legacy/radio.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/drivers/net/wireless/broadcom/b43legacy/radio.c b/drivers/net/wireless/broadcom/b43legacy/radio.c\n> index 9501420340a9..eab1c9387846 100644\n> --- a/drivers/net/wireless/broadcom/b43legacy/radio.c\n> +++ b/drivers/net/wireless/broadcom/b43legacy/radio.c\n> @@ -280,7 +280,7 @@ u8 b43legacy_radio_aci_detect(struct b43legacy_wldev *dev, u8 channel)\n>  u8 b43legacy_radio_aci_scan(struct b43legacy_wldev *dev)\n>  {\n>  \tstruct b43legacy_phy *phy = &dev->phy;\n> -\tu8 ret[13];\n> +\tu8 ret[13] = { 0 };\n>  \tunsigned int channel = phy->channel;\n>  \tunsigned int i;\n>  \tunsigned int j;\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 3xmzQL2rffz9t2v\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  6 Sep 2017 06:51:06 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753317AbdIEUuy (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 5 Sep 2017 16:50:54 -0400","from bues.ch ([80.190.117.144]:48857 \"EHLO bues.ch\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753095AbdIEUut (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tTue, 5 Sep 2017 16:50:49 -0400","by bues.ch with esmtpsa (Exim 4.84_2) (envelope-from <m@bues.ch>)\n\tid 1dpKJU-0002NK-94; Tue, 05 Sep 2017 22:19:12 +0200"],"Date":"Tue, 5 Sep 2017 22:18:28 +0200","From":"Michael =?utf-8?b?QsO8c2No?= <m@bues.ch>","To":"Colin King <colin.king@canonical.com>","Cc":"Larry Finger <Larry.Finger@lwfinger.net>,\n\tKalle Valo <kvalo@codeaurora.org>,\n\tlinux-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","Subject":"Re: [PATCH 2/2] b43legacy: fix unitialized reads of ret by\n\tinitializing the array to zero","Message-ID":"<20170905221705.3a5c4ffa@wiggum>","In-Reply-To":"<20170905181658.23893-1-colin.king@canonical.com>","References":"<20170905181658.23893-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_/rTL4C4h=cV3+DjO11=n_ZB9\";\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"}}]