Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4418592pxa; Mon, 10 Aug 2020 08:38:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRVM/Bo16LXqMAdbu4WdBFyKrY7gfIkBe+VaPErF0nA0IRvu1oKlyW4QMrkXmrQQ5Ebv9/ X-Received: by 2002:a17:906:cc47:: with SMTP id mm7mr20899324ejb.362.1597073887468; Mon, 10 Aug 2020 08:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597073887; cv=none; d=google.com; s=arc-20160816; b=HXbsfT6DlOcSQFcIOZzIt9it0z6AOx/qDtV9yT9wb64SgJK/7pcbY8tkvdAMWcFqWs ZaXEPISQ1aebAGoOJJLJUtuazv1ebBymU4A7BCuCBuZ8SyRAM5IRShKP9xPKNbnsII6B grpemwbt3be1Qxvi/vnOLwvw440kBoXGSRVhm7LjV9LgAACvYte/SidPACXpBr5kX9GZ EpTnhDMNE6rPsj/zXeQxgiUp3wZroV9tC+wZlef4l7KLavi75tAAcaCF1cbKih5rvdYO 1eawsRTnTPvcZOAmjTDD5+jsc/xVdDeVVSoMXilRC/IjpFIFpO2ZIwXng5i8T0ThELCe EXhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N3JZrQkYeaEMwTmq/vdAuM3FkzFlhlKV0f2Dg4kTmhI=; b=vmxfhsojFVD9kFy/PL03gevLkhbNqgaOUN2l5XMow1ksuNmUuxFIoZqMf+fjgW9D8j dQYWuzOfsvgsinw7lbnWQw9zPtJxWmYXvcJ4dAnx9z8bLI/VMc3VIleLQVfazf3Nebwe XTDxup0cjVZU3npngro0nf/dYCPofuftBY+sAnOnXSJfPWFCmI5mok0bBwqznqSpZq1S VXjAe6q/3872Qv9imVLpyKrvihk5RCGjQL3SDJCbikENjeEDAzU5vsmjpgimwQVYuzYe 27QUtzoyvsaeKBJCIRmqPwJL0kcVMM/NViK1GBqgqgNUrr/JTy0pBRTRMf8e7GH6iJNq W0sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r9vqoCdI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k13si10770845ejb.579.2020.08.10.08.37.43; Mon, 10 Aug 2020 08:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r9vqoCdI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728621AbgHJP00 (ORCPT + 99 others); Mon, 10 Aug 2020 11:26:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:60304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728290AbgHJP0Y (ORCPT ); Mon, 10 Aug 2020 11:26:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68D8B20772; Mon, 10 Aug 2020 15:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597073183; bh=srrFngW9COZ0NBOZJ12ulz2veNOxnhxSRLVj9eaA6Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r9vqoCdIqg7VkhBzyPYVvw81QR31yrE99ta1K4z1jhHB3eFq4ljWlRsaj+C5HeIX1 oaiFBbwHHqyt8CvU9BAqZD7v27N8swNhM8zdbClvjY/N007OBbOiZ1nrqYIPtyhuer 029d2nGrK85ZZsu5zCLnChVzMbyf2nRCzWTqRQDg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Dinghao Liu Subject: [PATCH 5.4 16/67] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode Date: Mon, 10 Aug 2020 17:21:03 +0200 Message-Id: <20200810151810.227925994@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200810151809.438685785@linuxfoundation.org> References: <20200810151809.438685785@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu commit 11536442a3b4e1de6890ea5e805908debb74f94a upstream. The variable authmode can be uninitialized. The danger would be if it equals to _WPA_IE_ID_ (0xdd) or _WPA2_IE_ID_ (0x33). We can avoid this by setting it to zero instead. This is the approach that was used in the rtl8723bs driver. Fixes: 7b464c9fa5cc ("staging: r8188eu: Add files for new driver - part 4") Co-developed-by: Dan Carpenter Signed-off-by: Dan Carpenter Signed-off-by: Dinghao Liu Cc: stable Link: https://lore.kernel.org/r/20200728072153.9202-1-dinghao.liu@zju.edu.cn Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -1729,9 +1729,11 @@ int rtw_restruct_sec_ie(struct adapter * if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK)) authmode = _WPA_IE_ID_; - if ((ndisauthmode == Ndis802_11AuthModeWPA2) || + else if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) authmode = _WPA2_IE_ID_; + else + authmode = 0x0; if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);