Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp885386rwb; Mon, 26 Sep 2022 07:07:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WLoelkWQ9ps3LHn4wzk1iNiH5gmWHOkX8szKxgh8KaenoceenqGPuiwVgLcBQKCnBpK6q X-Received: by 2002:a05:6a00:2350:b0:541:b5bf:2774 with SMTP id j16-20020a056a00235000b00541b5bf2774mr23687241pfj.28.1664201220448; Mon, 26 Sep 2022 07:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664201220; cv=none; d=google.com; s=arc-20160816; b=Y6h4EWi3oKShtNxX6dUVSj1jgL6dhrDLnE1jKRMtC3vxoAXYqYdgvooJcoGMX8NkjZ qMfHYsgRcp3Vpzsxt2NcVb1PbuNJUkRwkhVQvzeaBbTzJJ5ebOme5bYdIIF8MXboPi+G 7KpqLKG1SM8qjqfIiRLotcZaXHAII3PPiai+ynpWZHd0zwYouIjVuRyRbjZAAwCMocHx wo7vPQLfgedf2GiSUkstnmLLLZXBhc5ldeUQqLw2AFYUaINuT9D1q1OYXp8JkKSp4SAd n4VJDUI4FecaYdWZdIRi7bVzOdWPAi4SFgffNmx0O1jVMYzCTpjDyWvakYrmrPo8SCmI luyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aNt9JFrPgrqCfOpjddpcyhMZ2nx27G0f5PKj26IAU5I=; b=AfPZ+jUtnOlbbtM5yYePzs9EozKEhaw8h/+SCV+c6uEiWWesW4cLKbfU83LpPk11/o KiHfQJzD7LMCpXNRRWe3IH24DaZn0wRsErk0ILSBGUVn94jWgzj/LQqd79UpRLr9yIKE /JemJQCsNg3gL9GeIxYp16wsk3oCNpu8I/co9wZs3cfqZVAcHBooyfsw2Cl9N7JI48fV JPZoPzVsnEEcfSOmYGicTkbh2Pt+Skekrp5MhZZQ5hbnp2igizygs+eH7EwPMJ5554NK YLIko+kFLDMeEKFN8KQF2lxqbpjSUs34vFGAK30NMZ7vw0rAQwcdNeaukV2huICIfwdz zxPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1T5QjBlF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a170902f60200b0017824e7065csi11274286plg.128.2022.09.26.07.06.40; Mon, 26 Sep 2022 07:07:00 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1T5QjBlF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238137AbiIZLg2 (ORCPT + 99 others); Mon, 26 Sep 2022 07:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234297AbiIZLeq (ORCPT ); Mon, 26 Sep 2022 07:34:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68FDA54C9A; Mon, 26 Sep 2022 03:43:34 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5C9E860A5F; Mon, 26 Sep 2022 10:43:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 519DBC433C1; Mon, 26 Sep 2022 10:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189010; bh=h62gcAl4gT4CrilNk44RC8TlqH/0u0SPMz0hKFHNtUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1T5QjBlFcwVF1b6zeLfksdd1pas6cVT8L9H/03mTywJhIybfMQK+47bY3Sh7vunt5 ouxOe8RdlEjCh4VlynOkC+M5s3cQ7QIF6AdW+3cafp8V2TNwjTPPh4EQTYMo9Y4dDY J1nUQ18BMvRQ64wt349mDM8g/SI8sedILR2TCrMI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , Dongliang Mu , Johan Hovold Subject: [PATCH 5.19 045/207] media: flexcop-usb: fix endpoint type check Date: Mon, 26 Sep 2022 12:10:34 +0200 Message-Id: <20220926100808.634174529@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 From: Johan Hovold commit 763679f0eeff0185fc431498849bbc1c24460875 upstream. Commit d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type") tried to add an endpoint type sanity check for the single isochronous endpoint but instead broke the driver by checking the wrong descriptor or random data beyond the last endpoint descriptor. Make sure to check the right endpoint descriptor. Fixes: d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type") Cc: Oliver Neukum Cc: stable@vger.kernel.org # 5.9 Reported-by: Dongliang Mu Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220822151027.27026-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/b2c2/flexcop-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -511,7 +511,7 @@ static int flexcop_usb_init(struct flexc if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1) return -ENODEV; - if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[1].desc)) + if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[0].desc)) return -ENODEV; switch (fc_usb->udev->speed) {