* [PATCH 1/7] ath9k: fix storage endpoint lookup
2019-12-10 11:44 [PATCH 0/7] wireless: fix USB altsetting bugs Johan Hovold
@ 2019-12-10 11:44 ` Johan Hovold
2019-12-18 17:58 ` Kalle Valo
2019-12-10 11:44 ` [PATCH 2/7] at76c50x-usb: fix endpoint debug message Johan Hovold
` (5 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Johan Hovold @ 2019-12-10 11:44 UTC (permalink / raw)
To: Kalle Valo
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold,
stable
Make sure to use the current alternate setting when verifying the
storage interface descriptors to avoid submitting an URB to an invalid
endpoint.
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: 36bcce430657 ("ath9k_htc: Handle storage devices")
Cc: stable <stable@vger.kernel.org> # 2.6.39
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/net/wireless/ath/ath9k/hif_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index fb649d85b8fc..dd0c32379375 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1216,7 +1216,7 @@ static void ath9k_hif_usb_firmware_cb(const struct firmware *fw, void *context)
static int send_eject_command(struct usb_interface *interface)
{
struct usb_device *udev = interface_to_usbdev(interface);
- struct usb_host_interface *iface_desc = &interface->altsetting[0];
+ struct usb_host_interface *iface_desc = interface->cur_altsetting;
struct usb_endpoint_descriptor *endpoint;
unsigned char *cmd;
u8 bulk_out_ep;
--
2.24.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/7] ath9k: fix storage endpoint lookup
2019-12-10 11:44 ` [PATCH 1/7] ath9k: fix storage endpoint lookup Johan Hovold
@ 2019-12-18 17:58 ` Kalle Valo
0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2019-12-18 17:58 UTC (permalink / raw)
To: Johan Hovold
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold,
stable
Johan Hovold <johan@kernel.org> wrote:
> Make sure to use the current alternate setting when verifying the
> storage interface descriptors to avoid submitting an URB to an invalid
> endpoint.
>
> 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: 36bcce430657 ("ath9k_htc: Handle storage devices")
> Cc: stable <stable@vger.kernel.org> # 2.6.39
> Signed-off-by: Johan Hovold <johan@kernel.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
0ef332951e85 ath9k: fix storage endpoint lookup
--
https://patchwork.kernel.org/patch/11282013/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/7] at76c50x-usb: fix endpoint debug message
2019-12-10 11:44 [PATCH 0/7] wireless: fix USB altsetting bugs Johan Hovold
2019-12-10 11:44 ` [PATCH 1/7] ath9k: fix storage endpoint lookup Johan Hovold
@ 2019-12-10 11:44 ` Johan Hovold
2019-12-18 19:06 ` Kalle Valo
2019-12-10 11:44 ` [PATCH 3/7] brcmfmac: fix interface sanity check Johan Hovold
` (4 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Johan Hovold @ 2019-12-10 11:44 UTC (permalink / raw)
To: Kalle Valo
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold
Make sure to use the current alternate setting, which may not be the
same as the first alternate setting, also when printing the number of
endpoints at probe.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/net/wireless/atmel/at76c50x-usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c
index db2c3b8d491e..3b2680772f03 100644
--- a/drivers/net/wireless/atmel/at76c50x-usb.c
+++ b/drivers/net/wireless/atmel/at76c50x-usb.c
@@ -2236,7 +2236,7 @@ static int at76_alloc_urbs(struct at76_priv *priv,
at76_dbg(DBG_PROC_ENTRY, "%s: ENTER", __func__);
at76_dbg(DBG_URB, "%s: NumEndpoints %d ", __func__,
- interface->altsetting[0].desc.bNumEndpoints);
+ interface->cur_altsetting->desc.bNumEndpoints);
ep_in = NULL;
ep_out = NULL;
--
2.24.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/7] at76c50x-usb: fix endpoint debug message
2019-12-10 11:44 ` [PATCH 2/7] at76c50x-usb: fix endpoint debug message Johan Hovold
@ 2019-12-18 19:06 ` Kalle Valo
0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2019-12-18 19:06 UTC (permalink / raw)
To: Johan Hovold
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold
Johan Hovold <johan@kernel.org> wrote:
> Make sure to use the current alternate setting, which may not be the
> same as the first alternate setting, also when printing the number of
> endpoints at probe.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>
6 patches applied to wireless-drivers-next.git, thanks.
af615abd1596 at76c50x-usb: fix endpoint debug message
3428fbcd6e6c brcmfmac: fix interface sanity check
b73e05aa543c orinoco_usb: fix interface sanity check
39a4281c312f rtl8xxxu: fix interface sanity check
3139b180906a rsi_91x_usb: fix interface sanity check
2d68bb2687ab zd1211rw: fix storage endpoint lookup
--
https://patchwork.kernel.org/patch/11282005/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/7] brcmfmac: fix interface sanity check
2019-12-10 11:44 [PATCH 0/7] wireless: fix USB altsetting bugs Johan Hovold
2019-12-10 11:44 ` [PATCH 1/7] ath9k: fix storage endpoint lookup Johan Hovold
2019-12-10 11:44 ` [PATCH 2/7] at76c50x-usb: fix endpoint debug message Johan Hovold
@ 2019-12-10 11:44 ` Johan Hovold
2019-12-10 11:44 ` [PATCH 4/7] orinoco_usb: " Johan Hovold
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-12-10 11:44 UTC (permalink / raw)
To: Kalle Valo
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold,
stable
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 <stable@vger.kernel.org> # 3.4
Cc: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index 06f3c01f10b3..7cdfde9b3dea 100644
--- 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 *intf, const struct usb_device_id *id)
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 *intf, const struct usb_device_id *id)
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;
--
2.24.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/7] orinoco_usb: fix interface sanity check
2019-12-10 11:44 [PATCH 0/7] wireless: fix USB altsetting bugs Johan Hovold
` (2 preceding siblings ...)
2019-12-10 11:44 ` [PATCH 3/7] brcmfmac: fix interface sanity check Johan Hovold
@ 2019-12-10 11:44 ` Johan Hovold
2019-12-10 11:44 ` [PATCH 5/7] rtl8xxxu: " Johan Hovold
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-12-10 11:44 UTC (permalink / raw)
To: Kalle Valo
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold,
stable
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: 9afac70a7305 ("orinoco: add orinoco_usb driver")
Cc: stable <stable@vger.kernel.org> # 2.6.35
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
index 40a8b941ad5c..8c79b963bcff 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
@@ -1608,9 +1608,9 @@ static int ezusb_probe(struct usb_interface *interface,
/* set up the endpoint information */
/* check out the endpoints */
- iface_desc = &interface->altsetting[0].desc;
+ iface_desc = &interface->cur_altsetting->desc;
for (i = 0; i < iface_desc->bNumEndpoints; ++i) {
- ep = &interface->altsetting[0].endpoint[i].desc;
+ ep = &interface->cur_altsetting->endpoint[i].desc;
if (usb_endpoint_is_bulk_in(ep)) {
/* we found a bulk in endpoint */
--
2.24.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/7] rtl8xxxu: fix interface sanity check
2019-12-10 11:44 [PATCH 0/7] wireless: fix USB altsetting bugs Johan Hovold
` (3 preceding siblings ...)
2019-12-10 11:44 ` [PATCH 4/7] orinoco_usb: " Johan Hovold
@ 2019-12-10 11:44 ` Johan Hovold
2019-12-10 11:44 ` [PATCH 6/7] rsi_91x_usb: " Johan Hovold
2019-12-10 11:44 ` [PATCH 7/7] zd1211rw: fix storage endpoint lookup Johan Hovold
6 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-12-10 11:44 UTC (permalink / raw)
To: Kalle Valo
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold,
stable
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: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)")
Cc: stable <stable@vger.kernel.org> # 4.4
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index aa2bb2ae9809..54a1a4ea107b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -6384,7 +6384,7 @@ static int rtl8xxxu_parse_usb(struct rtl8xxxu_priv *priv,
u8 dir, xtype, num;
int ret = 0;
- host_interface = &interface->altsetting[0];
+ host_interface = interface->cur_altsetting;
interface_desc = &host_interface->desc;
endpoints = interface_desc->bNumEndpoints;
--
2.24.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/7] rsi_91x_usb: fix interface sanity check
2019-12-10 11:44 [PATCH 0/7] wireless: fix USB altsetting bugs Johan Hovold
` (4 preceding siblings ...)
2019-12-10 11:44 ` [PATCH 5/7] rtl8xxxu: " Johan Hovold
@ 2019-12-10 11:44 ` Johan Hovold
2019-12-10 11:44 ` [PATCH 7/7] zd1211rw: fix storage endpoint lookup Johan Hovold
6 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-12-10 11:44 UTC (permalink / raw)
To: Kalle Valo
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold,
stable, Fariya Fatima
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: dad0d04fa7ba ("rsi: Add RS9113 wireless driver")
Cc: stable <stable@vger.kernel.org> # 3.15
Cc: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index a37a436df5fb..c3ba38ed0dd0 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -117,7 +117,7 @@ static int rsi_find_bulk_in_and_out_endpoints(struct usb_interface *interface,
__le16 buffer_size;
int ii, bin_found = 0, bout_found = 0;
- iface_desc = &(interface->altsetting[0]);
+ iface_desc = interface->cur_altsetting;
for (ii = 0; ii < iface_desc->desc.bNumEndpoints; ++ii) {
endpoint = &(iface_desc->endpoint[ii].desc);
--
2.24.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/7] zd1211rw: fix storage endpoint lookup
2019-12-10 11:44 [PATCH 0/7] wireless: fix USB altsetting bugs Johan Hovold
` (5 preceding siblings ...)
2019-12-10 11:44 ` [PATCH 6/7] rsi_91x_usb: " Johan Hovold
@ 2019-12-10 11:44 ` Johan Hovold
6 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-12-10 11:44 UTC (permalink / raw)
To: Kalle Valo
Cc: QCA ath9k Development, Arend van Spriel, Franky Lin,
Hante Meuleman, Chi-Hsien Lin, Wright Feng, Jes Sorensen,
Amitkumar Karwar, Siva Rebbagondla, Daniel Drake, Ulrich Kunitz,
linux-wireless, netdev, linux-usb, linux-kernel, Johan Hovold,
stable
Make sure to use the current alternate setting when verifying the
storage interface descriptors to avoid submitting an URB to an invalid
endpoint.
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: a1030e92c150 ("[PATCH] zd1211rw: Convert installer CDROM device into WLAN device")
Cc: stable <stable@vger.kernel.org> # 2.6.19
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
index 7b5c2fe5bd4d..8ff0374126e4 100644
--- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
@@ -1263,7 +1263,7 @@ static void print_id(struct usb_device *udev)
static int eject_installer(struct usb_interface *intf)
{
struct usb_device *udev = interface_to_usbdev(intf);
- struct usb_host_interface *iface_desc = &intf->altsetting[0];
+ struct usb_host_interface *iface_desc = intf->cur_altsetting;
struct usb_endpoint_descriptor *endpoint;
unsigned char *cmd;
u8 bulk_out_ep;
--
2.24.0
^ permalink raw reply related [flat|nested] 10+ messages in thread