Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2096061ybl; Thu, 30 Jan 2020 11:17:06 -0800 (PST) X-Google-Smtp-Source: APXvYqz1DsmkFnn+iLN5NBoKmTrWh0s1uub/LeFpfELlEm50ZA87qEM+OwQpC8mr/OxNXcDxoE5Z X-Received: by 2002:aca:3109:: with SMTP id x9mr3405941oix.107.1580411826748; Thu, 30 Jan 2020 11:17:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580411826; cv=none; d=google.com; s=arc-20160816; b=D00FS1g7MRMODkaMgxPAmTjWg9BsInIJpi1qOiQ14+piJ5n/Z14bdvH5jVUIfHFxis /ro9q+pLsyoHca/neLmVOD8KQOxofUmc/uq72zop3tBx5iDPoca+rXUzmxnHVX9x+AvN izxnsLltH1dbw3eVbNVDzasL9z5fOsgUWd8kSVWbHUvObW6D+mEdc6CwdgQaFTQMx7Qz ucnXq0lxm6i1FPlk/zSlwZtKFks12fIM2ZK3GQnW1mRltLtwEFgG1Ye9SedjrHwuXBGs 0sjHKaGSxeW+APv7BUOAWk7DAAKDCAxWGgfliZGlhVoD/AUoZLQX0tSllKiRWu4fNWrn YTnA== 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=6XBTHGdsuv17soQHQJyleRcqRU0hDhyggNRJBl6Wzdo=; b=TYeuKXctIlFwfqY/j6RRgOcFKJqxLQWIhZVOjSGJUbLh0mvIZJyz0S4osMswBfkZqg xlTXF7vEFpdfar4QSzr/ADFiVMX2RcCoQFfIBCwxm9KJfbPqT7ZqN35/MwRPFYxKvkG1 znqlGpz+y8UtPpCXtXxbsfQwHN74nSaiV/uCFISvn6izEGJ8mn5MNCgIPzLm9NXfoA0q dV5yYFuzmavFwtOY/bf653ZSwJXNh/iFrgb5vE+qm3Y6gOKOPnXMvtjv2gdxBxd33hrv 4jhSn0e9s9CHXp35ti64Hy4tO/1SadBKudeqXHOqeWT9T+Txkcz4flU4bowu1Tifykwo 5J5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a33m7KPb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si3123110oiv.13.2020.01.30.11.16.54; Thu, 30 Jan 2020 11:17:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a33m7KPb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730548AbgA3SnL (ORCPT + 99 others); Thu, 30 Jan 2020 13:43:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:51652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730531AbgA3SnH (ORCPT ); Thu, 30 Jan 2020 13:43:07 -0500 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 351F52082E; Thu, 30 Jan 2020 18:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580409786; bh=1M0YF0+4pADEq3v0NcUXt1p5XFbnlgw9zdlVcdV/OZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a33m7KPbTNmk3UY72apgdaGyxoGyLDKr5qxPHA1kxaLbyIs25ehmAEZuADflCyLBS lp8WOQFJro5E+Z7TnjzKKfYyv7n1ZiE/qNY1f+HuYVx1E+UGktLSyplVNXIp0lNKW7 9aGW2/wqN8sV8SenfQwC/yFz6g0kg8k1zUH7ZJ78= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arend van Spriel , Johan Hovold , Kalle Valo Subject: [PATCH 5.4 032/110] brcmfmac: fix interface sanity check Date: Thu, 30 Jan 2020 19:38:08 +0100 Message-Id: <20200130183619.190183475@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130183613.810054545@linuxfoundation.org> References: <20200130183613.810054545@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: Johan Hovold commit 3428fbcd6e6c0850b1a8b2a12082b7b2aabb3da3 upstream. Make sure to use the current alternate setting when verifying the interface descriptors to avoid binding to an invalid interface. Failing to do so could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets") Cc: stable # 3.4 Cc: Arend van Spriel Signed-off-by: Johan Hovold Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c @@ -1348,7 +1348,7 @@ brcmf_usb_probe(struct usb_interface *in goto fail; } - desc = &intf->altsetting[0].desc; + desc = &intf->cur_altsetting->desc; if ((desc->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || (desc->bInterfaceSubClass != 2) || (desc->bInterfaceProtocol != 0xff)) { @@ -1361,7 +1361,7 @@ brcmf_usb_probe(struct usb_interface *in num_of_eps = desc->bNumEndpoints; for (ep = 0; ep < num_of_eps; ep++) { - endpoint = &intf->altsetting[0].endpoint[ep].desc; + endpoint = &intf->cur_altsetting->endpoint[ep].desc; endpoint_num = usb_endpoint_num(endpoint); if (!usb_endpoint_xfer_bulk(endpoint)) continue;