Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1151680rwd; Thu, 18 May 2023 08:33:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5q46Ymv35GmQsouGpUFIRKRE81vai4FlQXly9imvkmftexgXf/uVVQHxNgKvn97dyz4nJh X-Received: by 2002:a17:902:e848:b0:1ae:501:e230 with SMTP id t8-20020a170902e84800b001ae0501e230mr3781381plg.11.1684423981955; Thu, 18 May 2023 08:33:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684423981; cv=none; d=google.com; s=arc-20160816; b=ctJ5OLEVEWOK4hlOeV47IVge+VpZPF6wA/vXgPlo3g8UtJFtdav6wxqi+4AZnjiB9F ckWSiflP42B1/GQFE1W12hSzBijytS1U3lzW8kr4Y5RPcoQZs5VUzgzZbFWnXqoS8mdO 8mK8du98kkWfz6GvzBg1a7nsThrkro4wgHEqBgnWu5/gS5egBGXT1rcBzIMyJiaXYoT2 jHtRYm15Tw9NKPTmIiwMozh66b5HuYj9Tx+7HYIi2GeGAd5X9RFu4Rv6rJIV8J/MPc8i ss1gc7qTHP+PLmFSaQHhHPwbl43iLiOo/rq2eZidmmRMtk6Zu4T93houcdIc6txeqqN7 6Zgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=4VRrUJINCDTgL39qcHCMFejGcQ2tysDNnqZTCWz8o+A=; b=I1KNNXH4PthCZ7L6+jSXCH/ghOLCW4C+6Bl1uegFd1wXM9c3NWDbU8lHOhRLROogCf QuLwwEz0B4LVkQDXet2WdFp4cKg48+OgvWPG+twvIB4XNLsUxwy/7J+PTPUsilgzvrT1 kC6Bdc1/1C35MqLik86tClEMYxVMP4quMY0dG//nQjdBbdsYSDnQP/yZp3F5Q/A+phl9 PgIIqKks5Uk+ki+j2bkaND0dzmZb0AGpODgewIwBb/5YWUYkgdXVqQbseIybI5d8ONe9 vdZ8hTFX+tVMyNxC1mlPLdMurwIKgZXiU4J5ERn+9WZOtRUIeSjWclLqBDabSTtufQjr uDmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a17090a6b4700b002476be78cd2si4398759pjl.121.2023.05.18.08.32.49; Thu, 18 May 2023 08:33:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231875AbjERPGE (ORCPT + 99 others); Thu, 18 May 2023 11:06:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbjERPEU (ORCPT ); Thu, 18 May 2023 11:04:20 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 89783E43 for ; Thu, 18 May 2023 08:04:01 -0700 (PDT) Received: (qmail 916250 invoked by uid 1000); 18 May 2023 10:56:17 -0400 Date: Thu, 18 May 2023 10:56:17 -0400 From: Alan Stern To: Helge Deller Cc: syzbot , Linus Torvalds , linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, bernie@plugable.com, linux-usb@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [fbdev?] [usb?] WARNING in dlfb_submit_urb/usb_submit_urb (2) Message-ID: <2905a85f-4a3b-4a4f-b8fb-a4d037d6c591@rowland.harvard.edu> References: <0000000000004a222005fbf00461@google.com> <4cd17511-2b60-4c37-baf3-c477cf6d1761@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org On Thu, May 18, 2023 at 04:16:33PM +0200, Helge Deller wrote: > On 5/18/23 15:54, Alan Stern wrote: > > On Thu, May 18, 2023 at 09:34:24AM +0200, Helge Deller wrote: > > > I think this is an informational warning from the USB stack, > > > > It is not informational. It is a warning that the caller has a bug. > > I'm not a USB expert, so I searched for such bug reports, and it seems > people sometimes faced this warning with different USB devices. Yes. > > You can't fix a bug by changing the line that reports it from dev_WARN > > to printk! > > Of course this patch wasn't intended as "fix". > It was intended to see how the udlfb driver behaves in this situation, e.g. > if the driver then crashes afterwards. > > Furthermore, why does usb_submit_urb() prints this WARNING and then continues? > If it's a real bug, why doesn't it returns an error instead? > So, in principle I still think this warning is kind of informational, > which of course points to some kind of problem which should be fixed. Depending on the situation, the bug may or may not lead to an error. At the time the dev_WARN was added, we were less careful about these sorts of checks; I did not want to cause previously working devices to stop working by failing the URB submission. > > In this case it looks like dlfb_usb_probe() or one of the routines it > > calls is wrong; it assumes that an endpoint has the expected type > > without checking. More precisely, it thinks an endpoint is BULK when > > actually it is INTERRUPT. That's what needs to be fixed. > > Maybe usb_submit_urb() should return an error so that drivers can > react on it, instead of adding the same kind of checks to all drivers? Feel free to submit a patch doing this. But the checks should be added in any case; without them the drivers are simply wrong. Alan Stern