Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2200872rwb; Sat, 8 Oct 2022 04:09:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6w3Wj4aQm9ShTu8tDueMZanOGFZ97ATDtJgaqC1QgzsTPV8HKanFZEU9u0ADk+oEsmImQd X-Received: by 2002:a05:6a00:e8f:b0:536:c98e:8307 with SMTP id bo15-20020a056a000e8f00b00536c98e8307mr9796168pfb.73.1665227384502; Sat, 08 Oct 2022 04:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665227384; cv=none; d=google.com; s=arc-20160816; b=eCdT6UJTFAxqZuN7jiwxDKSSbkPv6OqL5aeLr9HtokJcHju9Dzn6s6Zu3LPnllRf/x Aht0pW4x36BnTjkZkzVCn0nCuleRidBJm1YcoP1ugaLcODalefePcN05ynnfKWgUS9oE liJffaN5sbMp/OQfBdNCt2hSSmm/KULk+xq/2nYOI7b5XO0MhSecCPteLOWp0YmQRZ70 1QlSePWA4pJpBl6vA8mLUso7hLwI8ybrzltbiCt3sv99pKs6RIh7LcRTTzTefnuQN+bz m3OcGXujBHdjZ0lO0xUfUpLd+BWY/X55G7Uhe2v9ZU+HnKTjdFoucF3wMR7JVx7IPS1S zTOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:from; bh=eU9kUp8m2tChn5413xwb6mbtXVh+lD9cSJ1I206oAP4=; b=vesyozzRb0GZ0DcuMgz+F9Z18YgfHQ9gj2YmhSwSrKJbtzq6hk6czsT9SNoCbc+LCG Qk30bkEfI9ctP1QZs7dkPS8tmqvxmGjZThhStMm5/pw3U3W7s4HtuHBZ8E2zZ8Y0nBST EkyFA4idnSlcgFP+DFizI35Ncvdp904OjeOMnkZahBZMkZJsXisPfn/UZpBvxkhPAVQ8 yrqEI0LG/zfZEP4smHERC+cDtNAI/2w+lgZZmqknZwEPmKEqmoxcDPWhQUwHXNMlcXYf THXQr3KhrnZPnDHi/gfLT2/p5CG/cbsx2AchD2EA9HAmgW/+Y6pafQyzkXYdHMBFityA aTCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=S8OT1XLT; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f18-20020a170902ce9200b0017d6ffda9e3si6013893plg.369.2022.10.08.04.09.35; Sat, 08 Oct 2022 04:09:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=S8OT1XLT; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229730AbiJHLJc (ORCPT + 61 others); Sat, 8 Oct 2022 07:09:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiJHLJa (ORCPT ); Sat, 8 Oct 2022 07:09:30 -0400 Received: from mail.toke.dk (mail.toke.dk [IPv6:2a0c:4d80:42:2001::664]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5D05481FE; Sat, 8 Oct 2022 04:09:28 -0700 (PDT) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1665227367; bh=lJSY4J+C5oo5opE5ORO0r3nywmHEQiHiYcIaI/WpDGQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=S8OT1XLTp0+3zOP/XglmVMZRl7xsVIqBbSO/U+15RUSN3POlJPbTyfiajSLpGRvYM Y4yf0WZCI+CA5HhE6PQDSkq2e0TI1YKWkARInRrkzmhnWFxp677xlapvCmflwD8ap/ GbJ+jq8C73j30nVep2IUjiNM1mkcRb3zVZX4EpR4/Skif/5uXKBsDN58/ve6a5IT/t Fsafk/m/F1ldrPZoucarFMhQfIHwtdYHHQb0FAzmsxf5gCKJDwEPtIJGN4g0vxpxyq Ta8LVd6XysP63q+4n+NeO8Zr0CLlHpAn/1Qdk0TyRrDfHOtRsiUoSTlOVNPnXiPMKV 0pcPYi3lYwbsQ== To: Fedor Pchelkin , Kalle Valo Cc: Fedor Pchelkin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org, Alan Stern Subject: Re: [PATCH v3] ath9k: verify the expected usb_endpoints are present In-Reply-To: <20221007212916.267004-1-pchelkin@ispras.ru> References: <20221007212916.267004-1-pchelkin@ispras.ru> Date: Sat, 08 Oct 2022 13:09:26 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87v8oushax.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fedor Pchelkin writes: > The bug arises when a USB device claims to be an ATH9K but doesn't > have the expected endpoints. (In this case there was an interrupt > endpoint where the driver expected a bulk endpoint.) The kernel > needs to be able to handle such devices without getting an internal error. > > usb 1-1: BOGUS urb xfer, pipe 3 != type 1 > WARNING: CPU: 3 PID: 500 at drivers/usb/core/urb.c:493 usb_submit_urb+0xce2/0x1430 drivers/usb/core/urb.c:493 > Modules linked in: > CPU: 3 PID: 500 Comm: kworker/3:2 Not tainted 5.10.135-syzkaller #0 > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 > Workqueue: events request_firmware_work_func > RIP: 0010:usb_submit_urb+0xce2/0x1430 drivers/usb/core/urb.c:493 > Call Trace: > ath9k_hif_usb_alloc_rx_urbs drivers/net/wireless/ath/ath9k/hif_usb.c:908 [inline] > ath9k_hif_usb_alloc_urbs+0x75e/0x1010 drivers/net/wireless/ath/ath9k/hif_usb.c:1019 > ath9k_hif_usb_dev_init drivers/net/wireless/ath/ath9k/hif_usb.c:1109 [inline] > ath9k_hif_usb_firmware_cb+0x142/0x530 drivers/net/wireless/ath/ath9k/hif_usb.c:1242 > request_firmware_work_func+0x12e/0x240 drivers/base/firmware_loader/main.c:1097 > process_one_work+0x9af/0x1600 kernel/workqueue.c:2279 > worker_thread+0x61d/0x12f0 kernel/workqueue.c:2425 > kthread+0x3b4/0x4a0 kernel/kthread.c:313 > ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:299 > > Found by Linux Verification Center (linuxtesting.org) with Syzkaller. > > Suggested-by: Alan Stern > Signed-off-by: Fedor Pchelkin > Signed-off-by: Alexey Khoroshilov > --- > v1->v2: use reverse x-mas tree ordering of the variable definitions > v2->v3: fix tab > > drivers/net/wireless/ath/ath9k/hif_usb.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c > index 4d9002a9d082..7bbbeb411056 100644 > --- a/drivers/net/wireless/ath/ath9k/hif_usb.c > +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c > @@ -1329,10 +1329,24 @@ static int send_eject_command(struct usb_interface *interface) > static int ath9k_hif_usb_probe(struct usb_interface *interface, > const struct usb_device_id *id) > { > + struct usb_endpoint_descriptor *bulk_in, *bulk_out, *int_in, *int_out; > struct usb_device *udev = interface_to_usbdev(interface); > + struct usb_host_interface *alt; > struct hif_device_usb *hif_dev; > int ret = 0; > Hmm, so your patch has spaces in this empty line which are not in the actual source file, which causes 'git am' to choke on the patch... :( Not sure what is causing this, but could you please see if you can fix it and resend? -Toke