From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29736C433B4 for ; Mon, 17 May 2021 13:47:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10F0C60FD8 for ; Mon, 17 May 2021 13:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237493AbhEQNsh (ORCPT ); Mon, 17 May 2021 09:48:37 -0400 Received: from netrider.rowland.org ([192.131.102.5]:42293 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S237499AbhEQNsf (ORCPT ); Mon, 17 May 2021 09:48:35 -0400 Received: (qmail 1085329 invoked by uid 1000); 17 May 2021 09:47:18 -0400 Date: Mon, 17 May 2021 09:47:18 -0400 From: Alan Stern To: Oliver Neukum Cc: Hayes Wang , syzbot , "davem@davemloft.net" , "kuba@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "netdev@vger.kernel.org" , "syzkaller-bugs@googlegroups.com" , nic_swsd Subject: Re: [syzbot] WARNING in rtl8152_probe Message-ID: <20210517134718.GC1083813@rowland.harvard.edu> References: <0000000000009df1b605c21ecca8@google.com> <7de0296584334229917504da50a0ac38@realtek.com> <20210513142552.GA967812@rowland.harvard.edu> <20210514153253.GA1007561@rowland.harvard.edu> <547984d34f58406aa2e37861d7e8a44d@realtek.com> <93a10a341eccd8b680cdcc422947e4a1b83099db.camel@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <93a10a341eccd8b680cdcc422947e4a1b83099db.camel@suse.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 12:00:19PM +0200, Oliver Neukum wrote: > Am Montag, den 17.05.2021, 01:01 +0000 schrieb Hayes Wang: > > Alan Stern > > > Sent: Friday, May 14, 2021 11:33 PM > > > > So if a peculiar emulated device created by syzbot is capable of > > > crashing the driver, then somewhere there is a bug which needs to > > > be > > > fixed. It's true that fixing all these bugs might not protect > > > against a > > > malicious device which deliberately behaves in an apparently > > > reasonable > > > manner. But it does reduce the attack surface. > > > > Thanks for your response. > > I will add some checks. > > Hi, > > the problem in this particular case is in > static bool rtl_vendor_mode(struct usb_interface *intf) > which accepts any config number. It needs to bail out > if you find config #0 to be what the descriptors say, > treating that as an unrecoverable error. No, the problem is that the routine calls WARN_ON_ONCE when it doesn't find an appropriate configuration. WARN_ON_ONCE means there is a bug or problem in the kernel. That's not the issue here; the issue is that the device doesn't have the expected descriptors. The line should be dev_warn(), not WARN_ON_ONCE. Alan Stern