lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220513140759.2196755-1-zheyuma97@gmail.com>
Date:   Fri, 13 May 2022 22:07:59 +0800
From:   Zheyu Ma <zheyuma97@...il.com>
To:     marcel@...tmann.org, johan.hedberg@...il.com, luiz.dentz@...il.com
Cc:     linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
        Zheyu Ma <zheyuma97@...il.com>
Subject: [PATCH v2] Bluetooth: bfusb: Check the endpoint type at probe

The driver reported an warning in usb_submit_urb() which is caused by
wrong endpoint type.

usb 1-1: BOGUS urb xfer, pipe 3 != type 1
WARNING: at drivers/usb/core/urb.c:503 usb_submit_urb+0xcd9/0x18b0
RIP: 0010:usb_submit_urb+0xcd9/0x18b0
Call Trace:
 <TASK>
 bfusb_rx_submit+0x24e/0x390 [bfusb]
 bfusb_open+0x50/0x90 [bfusb]

Fix this by checking the endpoint type at first.

Signed-off-by: Zheyu Ma <zheyuma97@...il.com>
---
Changes in v2:
    - Format the commit message
---
 drivers/bluetooth/bfusb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index cab93935cc7f..447b6876c552 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -613,7 +613,9 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 	bulk_out_ep = &intf->cur_altsetting->endpoint[0];
 	bulk_in_ep  = &intf->cur_altsetting->endpoint[1];
 
-	if (!bulk_out_ep || !bulk_in_ep) {
+	if (!bulk_out_ep || !bulk_in_ep ||
+		!usb_endpoint_is_bulk_out(&bulk_out_ep->desc) ||
+		!usb_endpoint_is_bulk_in(&bulk_in_ep->desc)) {
 		BT_ERR("Bulk endpoints not found");
 		goto done;
 	}
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ