Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4495084pxb; Tue, 31 Aug 2021 06:38:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxekAivsGO1t7nIw/4R3WFxT5mIAJapSWVfqdmwPDie05+OmWk/6nEVAxmaxc84mNtPdqx1 X-Received: by 2002:a17:906:368e:: with SMTP id a14mr32166100ejc.60.1630417106800; Tue, 31 Aug 2021 06:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630417106; cv=none; d=google.com; s=arc-20160816; b=ZXcwFhfZg9M/JeeHy0e3xTi8Tx4jAcPBrxR95dLbMfACMFxphwEXfFhkQMdaQICyno pKMUJfpp6lSxwxx4EcWTA/LLR4ykPHVs9+lW7gK7NiayIu1XweifpcfTK1TqqDnB4Ii7 5+fS7kuTyr0Eegq8n0sz9/t6dLPyM4vn1tWmtN+KAF4p66jg4VKMclWRRg8v4UqBFCnS WkCc6FpZUnjobGMS2I5K2v+8hNs5698eThWLAakpQbqpEonyhe/l12BwWohmMe/aA8FM JZjeQufxwX4puP80CRQjQV7ru2T5IjhsRXnqSD0BiWTZmMpBh6PCE0swEnPuEIMj9UjN k/5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=tJtK5+7Fqs+s928ij8No5Asm/iGC/Jmjx/9Tg1he2Ow=; b=w+ZE5mHhfIGnYT5iP2ac3i2rR+Q3+62G0jYE6iVShjApkVoiiGNcCEjg6Z1YkvlPZ7 y6+bHoMvCmXDsmokqaLLJw85JVUPPsdiQnwLDok+BnIxnJZ1ZpEzO2UxKlu0RLfBerT7 3E1VB2zG9wnvcFAmxHLEGu7UEIpz1pgQ+A3CfQwmvK7RouWgmqQJXEv5Q0NYtzNXP24D 80poKbzMPBJq2SdadKJVWQTOaC3zeBTpqkfB77pPZwNQmF+L0j2ZOqvDq/CfezTt91B/ 62xWev+rmcufWx3e1hc/qJId7vgT8t4zwFsGXTVv4dzg9Dr1xvHAdHhFxefcqbzk95Du UaRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b20si17616638edw.120.2021.08.31.06.38.01; Tue, 31 Aug 2021 06:38:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237418AbhHaNfg (ORCPT + 99 others); Tue, 31 Aug 2021 09:35:36 -0400 Received: from netrider.rowland.org ([192.131.102.5]:57649 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S237489AbhHaNff (ORCPT ); Tue, 31 Aug 2021 09:35:35 -0400 Received: (qmail 366261 invoked by uid 1000); 31 Aug 2021 09:34:38 -0400 Date: Tue, 31 Aug 2021 09:34:38 -0400 From: Alan Stern To: Benjamin Tissoires Cc: Jiri Kosina , syzbot , "open list:HID CORE LAYER" , lkml , Linux USB Mailing List , Michal Kubecek , syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] WARNING in hid_submit_ctrl/usb_submit_urb Message-ID: <20210831133438.GA365946@rowland.harvard.edu> References: <20210819195300.GA8613@rowland.harvard.edu> <000000000000c322ab05c9f2e880@google.com> <20210820140620.GA35867@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 31, 2021 at 11:51:31AM +0200, Benjamin Tissoires wrote: > On Tue, Aug 24, 2021 at 1:54 PM Jiri Kosina wrote: > > > > On Fri, 20 Aug 2021, Alan Stern wrote: > > > > > > syzbot has tested the proposed patch and the reproducer did not trigger any issue: > > > > > > That's good to know. Still, I suspect there's a better way of handling > > > this condition. > > > > > > In particular, does it make sense to accept descriptors for input or > > > feature reports with length zero? I can't imagine what good such > > > reports would do. > > > > I quickly went through drivers + some hidraw users, and can't spot any use > > case for it. > > > > > On the other hand, I'm not familiar enough with the code to know the > > > right way to reject these descriptors and reports. It looks like the > > > HID subsystem was not designed with this sort of check in mind. > > > > > > Benjamin and Jiri, what do you think? Is it okay to allow descriptors > > > for zero-length reports and just pretend they have length 1 (as the > > > patch tested by syzbot did), or should we instead reject them during > > > probing? > > > > I think it's a good band-aid for 5.14 (or 5.14-stable if we don't make > > it), and if it turns out to break something (which I don't expect), than > > we can look into rejecting already during probe. > > > > Benjamin, is there a way to run this quickly through your HID regression > > testing machinery? > > > > I have finally been able to test this patch: > - the testsuite is still passing (of course, this is not hid-core related) > - Logitech unify receivers are fine (according to the automated tests) > - Gaming mice with hidraw calls works (with libratbag in userspace) > - Wacom Intuos Pro still works (so the usbhid calls to enable the > tablet mode are still OK) > > -> > Tested-by: Benjamin Tissoires > Acked-by: Benjamin Tissoires > > Alan, would you mind resending the patch with the various tags with a > commit description? (unless I missed it...) Will do. I'm rather busy today, so it may have to wait until tomorrow. Alan Stern