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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B335ECAAD2 for ; Mon, 29 Aug 2022 14:51:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbiH2Ovl (ORCPT ); Mon, 29 Aug 2022 10:51:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiH2Ova (ORCPT ); Mon, 29 Aug 2022 10:51:30 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC6452A27E; Mon, 29 Aug 2022 07:51:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 0766CCE12A4; Mon, 29 Aug 2022 14:51:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF870C433B5; Mon, 29 Aug 2022 14:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661784685; bh=1D0W+JUuTCSdI7AzrUhn/hlZUpEEwVpbMnzddha3JUA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eQxSi2DeR2phw3xh3HceJX/KJGEAg8XqaNihdtr9RdIvSmSxvdhiVGbaCKcVJSTw3 vQrazrLaQvkaShQZre7DNIMhsyfNWQT9IeVpDb4Z84L1ln3C3a8Ph2zilbCLrPI6/r hz58KOeq+9LbAAWUrVXbqECfqFBBaBz0jzwyYdgI= Date: Mon, 29 Aug 2022 16:51:22 +0200 From: Greg KH To: Soumya Negi Cc: Dmitry Torokhov , Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [PATCH] Input: Check sanity of endpoint in pegasus_open() Message-ID: References: <20220829123959.21298-1-soumya.negi97@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220829123959.21298-1-soumya.negi97@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 29, 2022 at 05:39:59AM -0700, Soumya Negi wrote: > Fix WARNING in pegasus_open/usb_submit_urb > Syzbot bug: https://syzkaller.appspot.com/bug?id=bbc107584dcf3262253ce93183e51f3612aaeb13 > > Add sanity check of endpoint for Pegasus URB in pegasus_open() so that > transfer requests for bogus URBs are not submitted. If the URB is bogus > pegasus_open() will fail. > > Reported-by: syzbot+04ee0cb4caccaed12d78@syzkaller.appspotmail.com > Signed-off-by: Soumya Negi > --- > drivers/input/tablet/pegasus_notetaker.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c > index c608ac505d1b..5e47882ee4c0 100644 > --- a/drivers/input/tablet/pegasus_notetaker.c > +++ b/drivers/input/tablet/pegasus_notetaker.c > @@ -225,6 +225,15 @@ static int pegasus_open(struct input_dev *dev) > > mutex_lock(&pegasus->pm_mutex); > pegasus->irq->dev = pegasus->usbdev; > + > + /* Sanity check of endpoint in Pegasus URB */ > + error = usb_urb_ep_type_check(pegasus->irq); That is not checking for the type of the endpoint, so are you sure this works? And this should happen at probe time, not when the device is opened. thanks, greg k-h