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=-14.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 5529BC433E7 for ; Sun, 11 Oct 2020 06:35:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FC22207F7 for ; Sun, 11 Oct 2020 06:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602398116; bh=5QjCQmY9nBI+fZMUiGOVvN/onZQUa97idKKUVEH8t7E=; h=Subject:To:From:Date:List-ID:From; b=PWIEE2YkeHwMI+BfUU2Q2SDfMno/C37YRTorx6ZKB+X8nc6eBKaRH+ZIyirLqG/rC Vibk3UvAHRmzDjt3/nK3knG4kp13/YOugQRLHQFhwT9aCMzrGYLit72Cryu7KY9XQ+ N0Ktk3setIsfC79zCfGGCqJq2yRRl8uk8Xk4AIkg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728245AbgJKGfP (ORCPT ); Sun, 11 Oct 2020 02:35:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:50742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726342AbgJKGfP (ORCPT ); Sun, 11 Oct 2020 02:35:15 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6EAEC207F7; Sun, 11 Oct 2020 06:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602398115; bh=5QjCQmY9nBI+fZMUiGOVvN/onZQUa97idKKUVEH8t7E=; h=Subject:To:From:Date:From; b=fhky3nbGQftkMupoaZjFI5yt4DNCchl10Ca5FemZlnQ+BGZuHDlLr73dc3QXWNdJq KEiC8A0V0+v51RgA4Lyp6/qRvdLQv+0ZzlnLnT73/xPNLhVr8DsMGX/JogDpLogNhw tBtLAqcJwDYILjtqw0L4RtiBwTcgjnQXoHQ12f/0= Subject: patch "staging: comedi: check validity of wMaxPacketSize of usb endpoints" added to staging-next To: anant.thazhemadam@gmail.com, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Sun, 11 Oct 2020 08:34:56 +0200 Message-ID: <160239809687236@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled staging: comedi: check validity of wMaxPacketSize of usb endpoints to my staging git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git in the staging-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From e1f13c879a7c21bd207dc6242455e8e3a1e88b40 Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam Date: Sat, 10 Oct 2020 13:59:32 +0530 Subject: staging: comedi: check validity of wMaxPacketSize of usb endpoints found While finding usb endpoints in vmk80xx_find_usb_endpoints(), check if wMaxPacketSize = 0 for the endpoints found. Some devices have isochronous endpoints that have wMaxPacketSize = 0 (as required by the USB-2 spec). However, since this doesn't apply here, wMaxPacketSize = 0 can be considered to be invalid. Reported-by: syzbot+009f546aa1370056b1c2@syzkaller.appspotmail.com Tested-by: syzbot+009f546aa1370056b1c2@syzkaller.appspotmail.com Signed-off-by: Anant Thazhemadam Cc: stable Link: https://lore.kernel.org/r/20201010082933.5417-1-anant.thazhemadam@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/vmk80xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c index 65dc6c51037e..7956abcbae22 100644 --- a/drivers/staging/comedi/drivers/vmk80xx.c +++ b/drivers/staging/comedi/drivers/vmk80xx.c @@ -667,6 +667,9 @@ static int vmk80xx_find_usb_endpoints(struct comedi_device *dev) if (!devpriv->ep_rx || !devpriv->ep_tx) return -ENODEV; + if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx)) + return -EINVAL; + return 0; } -- 2.28.0